Ncat and starting command on boot

Please post questions that doesn't fall into the above categories here.

Ncat and starting command on boot

Postby NASCHARGE » Thu Jul 12, 2012 1:25 am

I have been playing with the program ncat (great little tool)
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
NASCHARGE
ReadyNAS Newbie
 
Posts: 18
Joined: Sat Feb 19, 2011 2:24 am

Re: Ncat and starting command on boot

Postby NASCHARGE » Thu Jul 12, 2012 3:47 pm

worked it out. just needed to add /usr/local in front of command.
NASCHARGE
ReadyNAS Newbie
 
Posts: 18
Joined: Sat Feb 19, 2011 2:24 am


Return to General Questions (English)



Who is online

Users browsing this forum: No registered users and 5 guests