#!/bin/sh
#
# startfile by newbiefan @ wl500g.info
# For Olegs & Ily's FW for Asus Routers
# store this script in /opt/etc/init.d if you've installed optware
# This script is used to copy several files to other places before services are started
# Particulary file hosts is used from several programs like mountnfs (use names instead of ip's)

# Prgmname=/full_path/Prgmname
prgmname="/opt/etc/hosts"
origin_name="/tmp/etc/hosts"

###########################End of Script configuration###################

start() {
        # Code here to start the program
	 [ -e $prgmname ] && cat $prgmname > $origin_name
	 [ -e /opt/etc/hosts.allow ] && cat /opt/etc/hosts.allow > /tmp/etc/hosts.allow
        return 0
}

stop() {
        # Code here to stop the program and check it's dead
	rm $origin_name
        rm /tmp/etc/hosts.allow
        return 0
}
##########################start here##########################
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac
sleep 1
exit
