#!/bin/sh obj=pdutar function kill_proc() { proc=$1 kill -9 $(ps | grep $proc | grep -v grep | awk '{print $1}') } function kill_all() { kill_proc smartMonitor.sh killall RestartApp.sh smartMornitor.sh smartMonitor.sh snmpd Qt_Test smartPDU sleep 1 echo V > /dev/watchdog sleep 1 echo V > /dev/watchdog } function rm_old() { rm -f /etc/init.d/S90PDUStart rm -rf /usr/local/snmpd rm -f /usr/lib/libnetsnmp* rm -f /usr/sbin/smartMornitor.sh rm -f /usr/libmpr.so /usr/libhttp.so /usr/lib/libesp.o /usr/lib/libmodbus* } function chg_net() { curIP=`ifconfig eth0 |sed -n '/inet addr/s/^[^:]*:\([0-9.]\{7,15\}\) .*/\1/p'` text="# interface file auto-generated by buildroot\n\ \n\ auto lo\n\ iface lo inet loopback\n\ \n\ auto eth0\n\ iface eth0 inet static\n\ address $curIP\n\ netmask 255.255.255.0\n\ gateway 192.168.1.1\n\ \n" echo -e $text > /etc/network/interfaces ifconfig eth0 $curIP } kill_all #rm_old cd /mnt/UDISK/ rm -rf app web fw #chg_net echo ++++ delete ok! ++++ exit 0