the following init script creates an empty mp3 file in your virtual usb drive whose name is the current IP
Code: Select all
# cat /mtd_rwcommon/SamyGO/etc/init.d/99_98_touch_my_ip.init
SpoilerShow
Code: Select all
#!/bin/busybox sh
#
#
. /dtv/SGO.env
case $1 in
start)
IP=`ifconfig eth0 |grep inet |cut -c -36`
IP=`echo $IP |sed -e 's/ /_/g'`
IP=`echo $IP |sed -e 's/:/_/g'`
touch $MOUNT_PATH/debug/$IP.mp3
;;
stop)
rm -r $MOUNT_PATH/debug
;;
restart)
$0 stop && $0 start || exit 1
;;
status)
ls -l $MOUNT_PATH/debug
;;
*)
echo "Usage: $0 {start|stop|restart|status}" 1>&2
exit 0
;;
esac