Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | writing an init script?

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > General IT Discussion
Register FAQ Community Calendar

writing an init script?
Reply
 
Thread Tools
Old 28-11-2004, 11:41   #1
dragon
Inactive
 
Join Date: Jan 2004
Posts: 3,898
dragon has reached the bronze age
dragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze age
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
dragon is offline   Reply With Quote
Advertisement
Old 28-11-2004, 11:54   #2
Graham M
Inactive
 
Graham M's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 41
Services: FreeSat+ Tivo V-Box VM 60MBit
Posts: 13,365
Graham M has a pair of shiny starsGraham M has a pair of shiny stars
Graham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny stars
Send a message via MSN to Graham M Send a message via Yahoo to Graham M
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!
Graham M is offline   Reply With Quote
Old 28-11-2004, 12:02   #3
dragon
Inactive
 
Join Date: Jan 2004
Posts: 3,898
dragon has reached the bronze age
dragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze age
Re: writing an init script?

THANKYOU worked a treat
dragon is offline   Reply With Quote
Old 28-11-2004, 12:08   #4
Graham M
Inactive
 
Graham M's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 41
Services: FreeSat+ Tivo V-Box VM 60MBit
Posts: 13,365
Graham M has a pair of shiny starsGraham M has a pair of shiny stars
Graham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny stars
Send a message via MSN to Graham M Send a message via Yahoo to Graham M
Re: writing an init script?

yay! do i get a rep?

Edit: Cheers
Graham M is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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