aboutsummaryrefslogtreecommitdiff
path: root/misc/g15daemon/rc.g15daemon
diff options
context:
space:
mode:
Diffstat (limited to 'misc/g15daemon/rc.g15daemon')
-rw-r--r--misc/g15daemon/rc.g15daemon22
1 files changed, 17 insertions, 5 deletions
diff --git a/misc/g15daemon/rc.g15daemon b/misc/g15daemon/rc.g15daemon
index 9bf247b83135e..b86efa03d4764 100644
--- a/misc/g15daemon/rc.g15daemon
+++ b/misc/g15daemon/rc.g15daemon
@@ -2,7 +2,7 @@
# rc script to start/stop g15daemon.
-# Copyright 2009 Alan Alberghini <414N@slacky.it>
+# Copyright 2011 Alan Alberghini <414N@slacky.it>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +22,23 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+G15DAEMON_PATH=/usr/sbin/g15daemon
+. /etc/rc.d/rc.g15daemon.conf
+NUM_PLUGINS=${#PLUGINS[*]}
+
function start()
{
echo -n "Starting g15daemon..."
- /usr/sbin/g15daemon
+ "$G15DAEMON_PATH"
+ if [ $NUM_PLUGINS -gt 0 ]
+ then
+ ( sleep 2 # Need a little time for g15daemon to settle
+ for I in $(seq 0 $NUM_PLUGINS)
+ do
+ ${PLUGINS[$I]} ${PLUGIN_PARAMS[$I]} &>/dev/null &
+ done ) &
+ fi
+ echo -ne "Done!\n"
}
function stop()
@@ -34,10 +47,9 @@ function stop()
if [ $(pidof g15daemon) ]
then
/usr/sbin/g15daemon -k
- return 0
+ echo -ne "Done!\n"
else
- echo "Failed! g15daemon not running!"
- return 1
+ echo -ne "Failed! g15daemon not running!\n"
fi
}