serverhost
fix
This commit is contained in:
1 parent
24736d0577
commit
84dfdf5210
38 files changed
+3146
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
echo "Check for Serverhost state"
|
||||
SHUTDOWN=true
|
||||
if [ $(cat /home/lucas/.auto_shutdown | grep yes | wc -l) -lt 1 ] ; then
|
||||
echo "Auto Shutdown disabled"
|
||||
SHUTDOWN=false
|
||||
fi
|
||||
if [ $(ps -elf | grep -e 'backup_all\.sh' | grep -v grep | wc -l) -ge 1 ]; then
|
||||
echo "Backup in progress"
|
||||
SHUTDOWN=false
|
||||
fi
|
||||
if [ $(ps -elf | grep -e 'upgrade\.sh' | grep -v grep | wc -l) -ge 1 ]; then
|
||||
echo "Upgrade in progress"
|
||||
SHUTDOWN=false
|
||||
fi
|
||||
if $SHUTDOWN; then
|
||||
echo "Shutdown serverhost"
|
||||
sudo /sbin/shutdown -P 1 +6
|
||||
ssh -o ConnectTimeout=4 -p 1504 lucas@quiethost 'notify-send "Shutdown SUCCESSFUL for Serverhost"'
|
||||
timeout 2s notify-send "Shutdown SUCESSFULL for Serverhost"
|
||||
else
|
||||
echo "Skip shutdown"
|
||||
ssh -o ConnectTimeout=4 -p 1504 lucas@quiethost 'notify-send "Shutdown FAILED for Serverhost"'
|
||||
timeout 2s notify-send "Shutdown FAILED for Serverhost"
|
||||
fi
|
||||
Reference in new issue
Block a user