What languages are supported for hookscripts? Perl obviously is as per /usr/share/pve-docs/examples/guest-example-hookscript.pl
Can I use any other languages?
Can I use any other languages?
#!/bin/bash
if [ "$2" == 'pre-start' ]
then
if /usr/sbin/qm status "100" | grep -q running
then
/usr/sbin/qm shutdown 100
fi
elif [ "$2" == 'post-stop' ]
then
if systemctl is-system-running | grep -v -q 'running'
then
echo "System shutting down, don't start VMs"
elif [ "$1" != "100" ]
then
nohup /usr/sbin/qm start 100 &>/dev/null &
fi
fi
snippets storage & set it to the config of the LXC/VM.I always forget to do this. Still relatively new to Linux.Please note you have to make that script executable...
We use essential cookies to make this site work, and optional cookies to enhance your experience.