Cable Forum

Cable Forum (https://www.cableforum.uk/board/index.php)
-   General IT Discussion (https://www.cableforum.uk/board/forumdisplay.php?f=19)
-   -   writing an init script? (https://www.cableforum.uk/board/showthread.php?t=20720)

dragon 28-11-2004 11:41

writing an init script?
 
im trying to write a initscript to run the command

portfwd -c pf.conf but tbh i dunno how to do it.

#!/bin/bash
#
# Init file for portfwd
#
# chkconfig: 2345 55 25
# description: portfwd
#

portfwd -c /usr/local/sbin/pf.conf


but it doesnt work

portfwd is in /usr/local/sbin/

id be gratefull if someone could tell me where im going wrong?


running portfwd -c /usr/local/sbin/pf.conf from the commandline works but i need it to be run on startup

Graham M 28-11-2004 11:54

Re: writing an init script?
 
If I remember correctly, when an init script runs the paths aren't set

so to get this to run, you'd need to put:

#!/bin/bash
#
# Init file for portfwd
#
# chkconfig: 2345 55 25
# description: portfwd
#

/usr/local/sbin/portfwd -c /usr/local/sbin/pf.conf


I am certain this is correct for CRON jobs and am pretty sure its the same for init scripts!

dragon 28-11-2004 12:02

Re: writing an init script?
 
THANKYOU :D worked a treat

Graham M 28-11-2004 12:08

Re: writing an init script?
 
yay! do i get a rep? :)

Edit: Cheers ;)


All times are GMT. The time now is 04:15.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum