forked from cdhowie/netflix-no-ipv6-dns-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetflix-no-ipv6-dns-proxy.init
executable file
·60 lines (49 loc) · 1.33 KB
/
netflix-no-ipv6-dns-proxy.init
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
56
57
58
59
60
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: netflix-no-ipv6-dns-proxy
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $network $syslog
# Should-Stop: $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop netflix-no-ipv6-dns-proxy
# Description: Fix the Netflix anti-v6 madness with v6 tunnel providers
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PIDFILE=/var/run/netflix-no-ipv6-dns-proxy.pid
DAEMON=/opt/netflix-no-ipv6-dns-proxy/server.py
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting Netflix domain name service fix..." "netflix-no-ipv6-dns-proxy"
modprobe capability >/dev/null 2>&1 || true
# dirs under /var/run can go away on reboots.
if start-stop-daemon --start -b --oknodo --quiet --exec $DAEMON \
--pidfile $PIDFILE --make-pidfile
then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping Netflix domain name service fix..." "netflix-no-ipv6-dns-proxy"
if start-stop-daemon --stop --oknodo --pidfile $PIDFILE
then
log_end_msg 0
rm -f $PIDFILE
else
log_end_msg 1
fi
;;
restart)
$0 stop
$0 start
;;
*)
log_action_msg "Usage: /etc/init.d/netflix-no-ipv6-dns-proxy {start|stop|restart}"
exit 1
;;
esac
exit 0