From 9e817169ca30f2944c8783605aa4cd940425d1c6 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 Oct 2023 12:21:48 +0200 Subject: [PATCH] Adding path to console connections --- app.py | 2 +- functions/fvnc.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index a743c83..90f68f4 100644 --- a/app.py +++ b/app.py @@ -234,7 +234,7 @@ def ter_connect(): def consolelxc(): lxc_name = request.form['lxc_name'] try: - pyxterm_connect(lxc_name) + pyxterm_connect(path,lxc_name) time.sleep(2) return render_template('terminal.html') except Exception as e: diff --git a/functions/fvnc.py b/functions/fvnc.py index ecb99b8..5456fe8 100644 --- a/functions/fvnc.py +++ b/functions/fvnc.py @@ -20,6 +20,6 @@ def socket_connect(vm_name): vm_port = get_vnc_port(vm_name) os.system('websockify -D --web=/usr/share/novnc/ 6080 localhost:'+vm_port) -def pyxterm_connect(lxc_name): +def pyxterm_connect(path,lxc_name): kill_consoles() - os.system('python3 pyxterm.py --command \'lxc-attach\' --cmd-args \''+lxc_name+'\' &') + os.system('python3 '+path+'/pyxterm.py --command \'lxc-attach\' --cmd-args \''+lxc_name+'\' &')