|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 10/22/2009 at 02:34PM PDT, ID: 24836269 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: |
echo "$(date "+%Y-%b-%d %H:%M:%S %Z") - Creating new /etc/rc.d/rc.local" >> /tmp/ks_install.log
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.org
cat > /etc/rc.d/rc.local << RCLOCAL
#!/bin/bash
echo "$(date "+%Y-%b-%d %H:%M:%S %Z") - -- Trying to Execute /usr/bin/python /tmp/esx_nic_fix.py" >> /tmp/ks_install.log
count=\`last -x|grep "reboot" |wc -l\`
if [ $count -ge 2 ]; then
echo "$(date "+%Y-%b-%d %H:%M:%S %Z") - -- -- Executing /usr/bin/python /tmp/esx_nic_fix.py" >> /tmp/ks_install.log
/usr/bin/python /tmp/esx_nic_fix.py
cp /etc/rc.d/rc.local.org /etc/rc.d/rc.local
rm /etc/rc.d/rc.local.org
chmod 644 /etc/rc.d/rc.local
echo "$(date "+%Y-%b-%d %H:%M:%S %Z") - -- -- Rebooting (esx_nic_fix)..." >> /tmp/ks_install.log
reboot
exit 0
fi
RCLOCAL
echo "$(date "+%Y-%b-%d %H:%M:%S %Z") - Creating new /etc/rc.d/rc.local ...done" >> /tmp/ks_install.log
|
Advertisement