diff options
author | Mark Wagie | 2021-12-01 16:29:50 -0700 |
---|---|---|
committer | Mark Wagie | 2021-12-01 16:29:50 -0700 |
commit | 96d98ab2596149904e87b12c2e43d3abc791cfd8 (patch) | |
tree | b6667932ac2aa6115cfa4246e794e4cd65c89fc6 | |
parent | d22738dc4e46b53183ca38cf2aa8e944d7e68882 (diff) | |
download | aur-96d98ab2596149904e87b12c2e43d3abc791cfd8.tar.gz |
minor PKGBUILD adjustments
-rw-r--r-- | mullvad-vpn.install | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/mullvad-vpn.install b/mullvad-vpn.install index 83aa74c47467..4f347b86666b 100644 --- a/mullvad-vpn.install +++ b/mullvad-vpn.install @@ -1,54 +1,54 @@ pre_install() { - if systemctl status mullvad-daemon &> /dev/null; then - echo 'Stopping & disabling Mullvad VPN daemon...' - /opt/Mullvad\ VPN/resources/mullvad-setup prepare-restart || true - systemctl disable --now mullvad-daemon - cp /var/log/mullvad-vpn/daemon.log /var/log/mullvad-vpn/old-install-daemon.log \ - || echo "Failed to copy old daemon log" - fi - - pkill -x "mullvad-gui" || true - - rm -f /var/cache/mullvad-vpn/relays.json - rm -f /var/cache/mullvad-vpn/api-ip-address.txt + if systemctl status mullvad-daemon &> /dev/null; then + echo 'Stopping & disabling Mullvad VPN daemon...' + /opt/Mullvad\ VPN/resources/mullvad-setup prepare-restart || true + systemctl disable --now mullvad-daemon + cp /var/log/mullvad-vpn/daemon.log /var/log/mullvad-vpn/old-install-daemon.log \ + || echo "Failed to copy old daemon log" + fi + + pkill -x "mullvad-gui" || true + + rm -f /var/cache/mullvad-vpn/relays.json + rm -f /var/cache/mullvad-vpn/api-ip-address.txt } post_install() { - chmod u+s "/usr/bin/mullvad-exclude" + chmod u+s "/usr/bin/mullvad-exclude" - echo 'Enabling Mullvad VPN daemon...' - systemctl enable --now mullvad-daemon + echo 'Enabling Mullvad VPN daemon...' + systemctl enable --now mullvad-daemon } pre_upgrade() { - pre_install + pre_install } post_upgrade() { - echo 'Starting & enabling Mullvad VPN daemon...' - systemctl daemon-reload - systemctl enable --now mullvad-daemon + echo 'Starting & enabling Mullvad VPN daemon...' + systemctl daemon-reload + systemctl enable --now mullvad-daemon - chmod u+s "/usr/bin/mullvad-exclude" + 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 - /opt/Mullvad\ VPN/resources/mullvad-setup reset-firewall || echo "Failed to reset firewall" - /opt/Mullvad\ VPN/resources/mullvad-setup clear-history || echo "Failed to remove leftover WireGuard keys" + /opt/Mullvad\ VPN/resources/mullvad-setup reset-firewall || echo "Failed to reset firewall" + /opt/Mullvad\ VPN/resources/mullvad-setup clear-history || echo "Failed to remove leftover WireGuard keys" } 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 -rf /etc/mullvad-vpn' - 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 -rf /etc/mullvad-vpn' + echo ------------------------------------------------------------- } |