You are not logged in.

#1 2008-07-04 19:15:15

sparkybean
Member
Registered: 2008-01-14
Posts: 38

auto add daemon

Hi all

Is there a script in the repo's that cam automatically add apps to the daemons list in rc.conf? Im making a few scripts, it it would help a bit.

Offline

#2 2008-07-04 20:10:29

carlocci
Member
From: Padova - Italy
Registered: 2008-02-12
Posts: 368

Re: auto add daemon

you can use sed:

sed -e "s/\(^DAEMONS=(.*\))/\1 YOURNEWDAEMONHERE)/" /etc/rc.conf

Of course you have to check the relative position of the daemons you add in order to satisfy dependencies.

Offline

#3 2008-07-04 20:37:20

sparkybean
Member
Registered: 2008-01-14
Posts: 38

Re: auto add daemon

excellent, works great. Is there a way to make sed remove daemons?

Offline

#4 2008-07-04 21:01:40

brynjolf
Member
From: Sweden
Registered: 2008-05-25
Posts: 63

Re: auto add daemon

It uses regex in most cases, could be worth investing some time to get to know regex, it is quite powerful once you learn it.
Some doc:
http://www.grymoire.com/Unix/Sed.html#uh-0
Sed one liners, good examples:
http://student.northpark.edu/pemente/sed/sed1line.txt


Cerebral: "Welcome to the distro.  You'll never leave.  Mwahaha"

Offline

#5 2008-07-04 21:22:46

sparkybean
Member
Registered: 2008-01-14
Posts: 38

Re: auto add daemon

that seems a bit too complicated for me :S

ive tried modding that script to replace/remove. hasnt worked. Can anyone help?

Offline

Board footer

Powered by FluxBB