I am trying to run a command to open a socket on boot
I have it working when I run the command from terminal but cant seem to get it happening at boot.
here's my command used & so it runs in background....
- Code: Select all
ncat -l -p 1717 --keep-open --sh-exec "echo hi there" &
I have created a file as follows
- Code: Select all
#! /bin/sh
case "$1" in
start)
echo "Starting script "
ncat -l -p 1717 --keep-open --sh-exec "echo hi there" &
;;
stop)
echo "Stopping script blah"
#add later
;;
*)
echo "Usage: /etc/init.d/ncat_sdown {start|stop}"
exit 1
;;
esac
exit 0
have added to startup by
- Code: Select all
update-rc.d test defaults
Any help would be appreciated.
Thanks
