Wip install scripts

This commit is contained in:
Joakim Hulthe
2026-04-23 10:23:16 +02:00
parent 31152057d6
commit 53e97a6dc2
4 changed files with 11 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ makedepends="
libnftnl-dev libnftnl-dev
" "
checkdepends="" checkdepends=""
install="$pkgname.post-install $pkgname.pre-upgrade $pkgname.post-upgrade $pkgname.pre-deinstall $pkgname.post-deinstall" install="$pkgname-systemd.post-install $pkgname.pre-upgrade $pkgname-systemd.post-upgrade $pkgname.pre-deinstall $pkgname.post-deinstall"
subpackages="$pkgname-systemd" subpackages="$pkgname-systemd"
source="" source=""
builddir="$srcdir/" builddir="$srcdir/"

View File

@@ -1,9 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad post-install" echo "mullvad-systemd post-install"
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
if systemctl status mullvad-daemon &> /dev/null; then # Does `mullvad-daemon.service` exist?
if systemctl list-unit-files mullvad-daemon.service &> /dev/null; then
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service" systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service"
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service" systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service" systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"

View File

@@ -1,9 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad post-upgrade" echo "mullvad-systemd post-upgrade"
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
if systemctl status mullvad-daemon &> /dev/null; then # Does `mullvad-daemon.service` exist?
if systemctl list-unit-files mullvad-daemon.service &> /dev/null; then
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service" systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service"
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service" systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service" systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"

View File

@@ -2,7 +2,9 @@
set -eu set -eu
echo "mullvad pre-upgrade" echo "mullvad pre-upgrade"
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
# Is `mullvad-daemon.service` running?
if systemctl status mullvad-daemon &> /dev/null; then if systemctl status mullvad-daemon &> /dev/null; then
mullvad-setup prepare-restart || true mullvad-setup prepare-restart || true
systemctl stop mullvad-daemon.service systemctl stop mullvad-daemon.service