From 94351a0d580af93f6a756615a2b6b03fbe0c9073 Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Sat, 20 May 2023 01:32:32 +0200 Subject: [PATCH] Fixed LXC start.sh --- start.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index de19d09..d3da13b 100644 --- a/start.sh +++ b/start.sh @@ -10,7 +10,14 @@ then sudo dnf install gnome-console -y fi echo "Restarting script in gnome-console..." - kgx -e "/bin/bash -c 'cd $(dirname "$(readlink -f "$0")"); ./$(basename "$0")'" & + if grep -q "container=lxc" /proc/1/environ || grep -q "container=lxc-libvirt" /proc/1/environ; then + Xvfb :1 -screen 0 1024x768x16 & + DISPLAY=:1.0 kgx -e "/bin/bash -c 'cd $(dirname "$(readlink -f "$0")"); ./$(basename "$0")'" & + else + kgx -e "/bin/bash -c 'cd $(dirname "$(readlink -f "$0")"); ./$(basename "$0")'" & + fi + + read -t 2 pkill -f "gnome-terminal" exit @@ -164,4 +171,4 @@ do send_webhook "ERROR: VPN name is empty" fi fi -done \ No newline at end of file +done