updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / freepops-bin / freepopsd
blobbcf6a58289d3f94e979887184b0132d95a1d8b3d
1 #!/bin/bash
3 # A script for launch FreePOPs at startup on Linux systems
4 # Version: 0.0.2
5 # Author: Ivan Gasperoni <gaspe (at) libero (dot) it>
7 . /etc/rc.conf
8 . /etc/rc.d/functions
10 PREFIX="/usr/bin" # The FreePOPs installation path
11 PID=`pidof -o %PPID /usr/bin/freepopsd` # freepopsd pid
13 case "$1" in
14 start)
15 stat_busy "Starting freepops deamon"
16 $PREFIX/freepopsd -d
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 stat_done
23 stop)
24 stat_busy "Stopping freepops deamon"
25 [ ! -z "$PID" ] && $PREFIX/freepopsd -k &> /dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 stat_done
32 restart)
33 $0 stop
34 sleep 3
35 $0 start
38 echo "Usage: freepops {start|stop|restart}"
39 exit 1
41 esac
42 exit 0