#!/bin/bash echo "args are $*" case $1 in poweroff) echo "rc.shutdown: powering off." ;; reboot) echo "rc.shutdown: rebooting." ;; *) echo "rc.shutdown: ERROR: command $1 wasn't recognised. Aborting." exit 20 esac