I'm executing a script on Ubuntu 14.04.1 LTS when the server is stopping
But I would like to execute it only on shutdown behavior, not whendoing a reboot.
I tried to get the value with $1but for reboot or shutdown, but it always sending a stop message
The script I'm currently running:
#! /bin/sh
### BEGIN INIT INFO
# Provides: shutdown
# Required-Start:
# Required-Stop: sendsigs
# Default-Start:
# Default-Stop: 0 6
# Short-Description: shutdown
# Description:
### END INIT INFO
shutdown_script.sh
exit 0
And run by
sudo update-rc.d shutdown_job start 19 0 6 .