lsb_release -a; # tested under
Description: Debian GNU/Linux 10 (buster)

su - root
# create new file
touch /scripts/shutdown.sh
chmod +x /scripts/shutdown.sh

# edit and insert orange content
vim /scripts/shutdown.sh 
#!/bin/bash
echo "=== shutdown as gracefully as possible ==="

# stop all vms
# /scripts/vboxmanage/stop.sh 

echo "... sending shutdown signal to nas"
ssh -v -p22 admin@192.168.2.230 'halt'

echo "... sync harddisks"
sync; sync; sync;

echo "... unmount mounts"
# this is where also nfs mounts should be
umount /media/user/*

echo "... shutting down system"
shutdown -h now;


# testedrive
/scripts/shutdown.sh
# it should ask for password for NAS
# after that there should be a beep from the NAS indicating it will shutdown
# (takes a long time to shutdown ~10min) hurray it works! :)

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin