Page 1 of 1
Need this to run at boot.....
Posted: Wed May 17, 2017 6:42 am
by n6vmo
I need this 'netcat' command to run at boot:
nc 192.168.xxx.xxx 30002 | nc 192.168.xxx.xxx 30001
Both these RPi's are located on remote mountain tops. I need to get it right and not lock anything up, or it is a long trip to correct it.
Thanks,
John
Re: Need this to run at boot.....
Posted: Wed May 17, 2017 6:55 am
by RaTTuS
are these running jessie ?
if so write a systemd.service
if you want to do a quick hack then stuff the commands into /etc/rc.local [this is not the way to do it as you will get issues]
Re: Need this to run at boot.....
Posted: Wed May 17, 2017 4:43 pm
by Tdi-Me
would this also be how to create a start up script to mount a usb hard drive?
I know i can modify fstab, but i screwed up once already and i would prefer to not do that again if possible

making a script that runs at startup seems like a very friendly way to do it that wont muck up the system being able to start if i flub a command. ( ok so its more like when i flub a command since its me lol )
Re: Need this to run at boot.....
Posted: Thu May 18, 2017 6:29 am
by RaTTuS
this is really a different question to the OP
if the USB drive is permanently plugged in then fstab is the way to do it
if the drive is plugged in and out then a udev rule is what you need
in either case ask in another thread - post a link to it if you wish
Re: Need this to run at boot.....
Posted: Thu May 18, 2017 10:00 am
by n6vmo
RaTTuS wrote:are these running jessie ?
if so write a systemd.service
if you want to do a quick hack then stuff the commands into /etc/rc.local [this is not the way to do it as you will get issues]
Yes, both of these machines are running jessie. I am looking into writing a systemd.service.