-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfnaa
executable file
·55 lines (49 loc) · 858 Bytes
/
fnaa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
### BEGIN INIT INFO
# Provides: fnaa
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: fdu network auto auth
### END INIT INFO
SERVICE_NAME="fnaa"
SCRIPT_PATH="/etc/fnaa/fdu_network_auto_auth.py"
PYTHON="python"
start() {
echo "starting $SERVICE_NAME ... ..."
$PYTHON $SCRIPT_PATH &
echo "$SERVICE_NAME started"
exit 0;
}
stop() {
echo "stopping $SERVICE_NAME ... ..."
pkill -f $SCRIPT_PATH
echo "$SERVICE_NAME stopped"
}
status() {
if [ -e $SERVICE_NAME ]; then
echo "$0 service started"
else
echo "$0 service stopped"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "usage: $0 start|stop|restart"
exit 0;
esac
exit