diff options
Diffstat (limited to 'mullvad-vpn-cli.install')
-rw-r--r-- | mullvad-vpn-cli.install | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/mullvad-vpn-cli.install b/mullvad-vpn-cli.install index b56ee3ea82d9..8de2edc48b46 100644 --- a/mullvad-vpn-cli.install +++ b/mullvad-vpn-cli.install @@ -1,8 +1,8 @@ pre_install() { - if systemctl status mullvad-daemon &> /dev/null; then - echo 'Stopping & disabling Mullvad VPN daemon...' - systemctl disable --now mullvad-daemon - fi + if systemctl status mullvad-daemon &> /dev/null; then + echo 'Stopping & disabling Mullvad VPN daemon...' + systemctl disable --now mullvad-daemon + fi } post_install() { @@ -13,34 +13,43 @@ post_install() { echo 'Please edit /etc/mullvad-vpn/settings.json' fi echo 'Enabling Mullvad VPN daemon...' - systemctl enable --now mullvad-daemon + systemctl enable mullvad-daemon + chmod u+s "/usr/bin/mullvad-exclude" + echo ----------------------------------------------------------------------------------- + echo 'Mullvad daemon enabled but not started because the CLI might be used remotely.' + echo 'Be aware that the daemon will be started after a reboot.' + echo 'Please start the daemon now if you want to:' + echo '' + echo 'systemctl start mullvad-daemon.service' + echo ----------------------------------------------------------------------------------- } pre_upgrade() { - echo 'Stopping Mullvad VPN daemon...' - systemctl stop mullvad-daemon + echo 'Stopping Mullvad VPN daemon...' + systemctl stop mullvad-daemon } post_upgrade() { - echo 'Restarting Mullvad VPN daemon...' - systemctl daemon-reload - systemctl start mullvad-daemon + echo 'Restarting Mullvad VPN daemon...' + systemctl daemon-reload + systemctl start mullvad-daemon + chmod u+s "/usr/bin/mullvad-exclude" } pre_remove() { - # the user might've disabled or stopped the service themselves already - echo 'Making sure the Mullvad VPN daemon is stopped & disabled...' - systemctl stop mullvad-daemon || true - systemctl disable mullvad-daemon || true + # the user might've disabled or stopped the service themselves already + echo 'Making sure the Mullvad VPN daemon is stopped & disabled...' + systemctl stop mullvad-daemon || true + systemctl disable mullvad-daemon || true } post_remove() { - echo ------------------------------------------------------------- - echo 'Optionally remove logs & cache:' - echo 'sudo rm -rf /var/log/mullvad-vpn/' - echo 'sudo rm -rf /var/cache/mullvad-vpn/' - echo '' - echo 'Optionally remove config:' - echo 'sudo rm /etc/mullvad-vpn/settings.json' - echo ------------------------------------------------------------- + echo ------------------------------------------------------------- + echo 'Optionally remove logs & cache:' + echo 'sudo rm -rf /var/log/mullvad-vpn/' + echo 'sudo rm -rf /var/cache/mullvad-vpn/' + echo '' + echo 'Optionally remove config:' + echo 'sudo rm /etc/mullvad-vpn/settings.json' + echo ------------------------------------------------------------- } |