6 # description: srsd is an SRS address rewriting daemon
10 # Source function library
11 . /etc/rc.d/init.d/functions
14 . /etc/sysconfig/network
17 SRSD_SECRET="/etc/srsd.secret"
18 SRSD_OLDSECRET="/etc/srsd.secret.1"
21 if [ -f "$SRSD_OLDSECRET" ]; then
22 SRSD_OPTIONS="$SRSD_OPTIONS --secretfile=$SRSD_OLDSECRET"
25 if [ -f "$SRSD_SECRET" ]; then
26 SRSD_OPTIONS="$SRSD_OPTIONS --secretfile=$SRSD_SECRET"
30 [ -f /etc/sysconfig/srsd ] && . /etc/sysconfig/srsd
32 # Check that networking is up.
33 if is_yes "${NETWORKING}"; then
34 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
35 # nls "ERROR: Networking is down. %s can't be run." <service>
44 # See how we were called.
47 # Check if the service is already running?
48 if [ ! -f /var/lock/subsys/srsd ]; then
50 daemon sh -c "srsd $SRSD_OPTIONS &"
52 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/srsd
54 msg_already_running srsd
59 if [ -f /var/lock/subsys/srsd ]; then
62 rm -f /var/lock/subsys/srsd > /dev/null 2>&1
77 msg_usage "$0 {start|stop|restart|force-reload|status}"