#!/bin/sh
echo "stopping NSC service"
service nsc stop
NEW_MAC=`cat /sys/class/net/sngdsp0/address`
echo "New MAC address = $NEW_MAC"
echo "Modifying sngdsp0 network settting"
sed -i "s#^HWADDR=.\+#HWADDR=$NEW_MAC#" /etc/sysconfig/network-scripts/ifcfg-sngdsp0
echo "Restarting network service"
service network restart
echo "Restoring network settings from linux config"
/usr/local/nsc/hooks/network.restore.post --mode=restore
echo "Updateing network settings from restore"
/usr/local/nsc/hooks/network.restore.post --mode=update
echo "Will now reboot the machine. After reboot, in the directory you uploaded the file, run 'python2.7 detect-modules.py'"
echo "Press enter to Reboot."
read anything
reboot
