Fixed LXC start.sh

This commit is contained in:
2023-05-20 01:32:32 +02:00
parent 6607399997
commit 94351a0d58

View File

@@ -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
done