From 061f5fe43c6989de590a8581e86bcff1d6228006 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Wed, 12 Jun 2024 13:39:38 +0200 Subject: [PATCH] Updated container start/stop scripts. --- scripts/poweroffall.sh | 8 -------- scripts/rebootall.sh | 6 +----- scripts/restartall.sh | 5 +++++ scripts/shutdownall.sh | 4 ++++ scripts/startall.sh | 4 ++++ 5 files changed, 14 insertions(+), 13 deletions(-) delete mode 100755 scripts/poweroffall.sh create mode 100755 scripts/restartall.sh create mode 100755 scripts/shutdownall.sh create mode 100755 scripts/startall.sh diff --git a/scripts/poweroffall.sh b/scripts/poweroffall.sh deleted file mode 100755 index 9af2adb..0000000 --- a/scripts/poweroffall.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - - -lxc-ls -1 --running | while read CONTAINER -do - echo "Powering off $CONTAINER" - lxc-attach --name $CONTAINER -- poweroff -done diff --git a/scripts/rebootall.sh b/scripts/rebootall.sh index 3284811..afe8a13 100755 --- a/scripts/rebootall.sh +++ b/scripts/rebootall.sh @@ -1,8 +1,4 @@ #!/bin/sh -lxc-ls -1 --running | while read CONTAINER -do - echo "Rebooting $CONTAINER" - lxc-attach --name $CONTAINER -- reboot -done +lxc-autostart --reboot diff --git a/scripts/restartall.sh b/scripts/restartall.sh new file mode 100755 index 0000000..920475a --- /dev/null +++ b/scripts/restartall.sh @@ -0,0 +1,5 @@ +#!/bin/sh + + +lxc-autostart --shutdown -t 300 +lxc-autostart diff --git a/scripts/shutdownall.sh b/scripts/shutdownall.sh new file mode 100755 index 0000000..0233aa9 --- /dev/null +++ b/scripts/shutdownall.sh @@ -0,0 +1,4 @@ +#!/bin/sh + + +lxc-autostart --shutdown -t 300 diff --git a/scripts/startall.sh b/scripts/startall.sh new file mode 100755 index 0000000..cccc4d2 --- /dev/null +++ b/scripts/startall.sh @@ -0,0 +1,4 @@ +#!/bin/sh + + +lxc-autostart -- 2.54.0