summaryrefslogtreecommitdiffstats
path: root/network/mullvadvpn-app/rc.mullvad
blob: 427f2e3fe6b8247247df46e215a925e7fa741651 (plain) (blame)
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
#!/bin/sh
#
# /etc/rc.d/rc.mullvad
#
# Start/stop/restart - Mullvad VPN Service.
#
# To make Mullvad VPN start automatically at boot, make this
# file executable:  chmod 755 /etc/rc.d/rc.mullvad
#
# and also you must add this to /etc/rc.d/rc.local to
# start MullvadVPN:
#
# if [ -x /etc/rc.d/rc.mullvad ]; then
#   /etc/rc.d/rc.mullvad start
# fi


case "$1" in
  'start')
    /usr/bin/mullvad-daemon -v >/dev/null &
  ;;
  'stop')
    pkill -f /usr/bin/mullvad-daemon >/dev/null &
    # Remove both possible .pid locations:
    rm -f /var/run/mullvad-vpn.pid /var/run/mullvad-vpn/mullvad-vpn.pid
  ;;
  'restart')
    /usr/bin/mullvad-daemon -v >/dev/null &
  ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
  ;;
esac