#!/bin/bash # # reboot_node - IRLP node rebooter v0.1 # Robert Pectol - http://rob.pectol.com/irlp # # *NOTE* Requires your /etc/sudoers file to have # have the following line: # # repeater ALL= NOPASSWD: /sbin/shutdown # ######################################################## # ensure script is run as repeater user if [ `/usr/bin/whoami` != "repeater" ] ; then echo "Must be run as user, 'repeater.'" exit 1 fi # ensure the environment file has been sourced if [ "$RUN_ENV" != "TRUE" ] ; then . /home/irlp/custom/environment fi # first disconnect if connected to anything if [ -f "$LOCAL"/active ]; then "$SCRIPT"/end || "$SCRIPT"/irlp_reset &>/dev/null 2>&1 echo "waiting for disconnect scripts to finish..." sleep 10 fi echo "shutting down now..." sudo /sbin/shutdown -r now exit 0