You are not logged in.
Pages: 1
Hello again,
long time - no arching.. heheh
I went back to ubuntuland for a while, but now I'm back!
I'm having a little trouble with networkmanager though, how are the scripts in /etc/NetworkManager/dispatcher.d/ supposed to work?
I tried something like this:
#!/bin/sh
/etc/rc.d/openntpd start
and it does start the openntpd daemon, but what happens at shutdown?? It's obviously not an issue with ntp but what about other services, will they get stopped properly?
This might just be me being paranoid again, but it actually bothers me..
Offline
i have something like this:
#!/bin/bash
case "$2" in
up)
if [ /etc/rc.d/ntpdate ]; then
/etc/rc.d/ntpdate start
fi
;;
down)
if [ /var/run/daemons/ntpdate ]; then
/etc/rc.d/ntpdate stop
fi
;;
esac
Last edited by wonder (2009-05-20 21:17:25)
Give what you have. To someone, it may be better than you dare to think.
Offline
Works great,
Thank you!
Offline
I'm trying to do something simular running netfs to mount some nfs when I'm at home.
When I run the script manually it runs fine, but my nfs doesn't get mounted at login/connect.
When do the the scripts in dispatcher.d run?
#!/bin/bash
ESSID=$(iwconfig wlan0 | awk '
/ESSID/{if( $NF ~ /ESSID:/ ){split($NF,a,"\"");if( a[2] )ssid=a[2]}}
END{if( ssid ){print ssid} else {print "config"}}
')
if [ "$1" = "wlan0" ]; then
if [ "$ESSID" = "jordz-wireless" ]; then
case "$2" in
up)
if [ ! -e /var/run/daemons/netfs ]; then
/etc/rc.d/netfs start
fi
;;
down)
if [ -e /var/run/daemons/netfs ]; then
/etc/rc.d/netfs stop
fi
;;
esac
fi
fi
Last edited by jordz (2009-05-26 23:35:08)
Offline
I fixed it I needed to give the full path of the binaries, $PATH wasn't set.
#!/bin/bash
ESSID=$(/usr/sbin/iwconfig wlan0 | /bin/awk '
/ESSID/{if( $NF ~ /ESSID:/ ){split($NF,a,"\"");if( a[2] )ssid=a[2]}}
END{if( ssid ){print ssid} else {print "config"}}
')
if [ "$1" = "wlan0" ]; then
if [ "$ESSID" = "jordz-wireless" ]; then
case "$2" in
up)
if [ ! -e /var/run/daemons/netfs ]; then
/etc/rc.d/netfs start
fi
;;
down)
if [ -e /var/run/daemons/netfs ]; then
/etc/rc.d/netfs stop
fi
;;
esac
fi
fi
Last edited by jordz (2009-06-05 11:22:41)
Offline
Pages: 1