updated on Wed Jan 18 04:00:29 UTC 2012
[aur-mirror.git] / wuala-daemon / wualatd.sh
blobf637ecf3923d8715e054220b2af6aa43f803f2ac
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 source /etc/profile
8 RUNNING=`pgrep -f "wuala -nogui" | wc --lines`
9 case "$1" in
10 start)
11 stat_busy "Starting wuala trading"
12 [ $RUNNING -eq 0 ] && su --command "~/wuala/wuala -nogui &" LinuxLoginName &> /dev/null;
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon wualatd
17 stat_done
20 stop)
21 stat_busy "Stopping wuala trading"
22 [ $RUNNING -gt 0 ] && su --command "~/wuala/wuala exit &" LinuxLoginName &> /dev/null;
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon wualatd
27 stat_done
30 restart)
31 $0 stop
32 sleep 10
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0