managing linux server remotely can be hard, especially when you need to phisically restart or shutdown the server.
these are scripts to hard reset or hard shutdown your linux machine, hard means just like you sit in front of your machine and hit the reset / power button.
force reboot your machine, just like “press the reset button”
$ echo 1 > /proc/sys/kernel/sysrq
$ echo b > /proc/sysrq-trigger
if you want to force shutdown machine, just like “press the power button”
$ echo 1 > /proc/sys/kernel/sysrq
$ echo o > /proc/sysrq-trigger
the script will bypass disc syncing, close application, daemon, etc. during regular reboot/shutdown process.
you will find this script useful when the machine is not responding, and you still have SSH session.
Advertisement