From 2c08891979ac14d5a464e4c8908ed7fbfe024259 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Wed, 3 Aug 2022 13:48:31 +0200
Subject: Improve systemd support for tinc playbook
---
playbooks.d/vpn-tinc/playbook.bash | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
(limited to 'playbooks.d/vpn-tinc')
diff --git a/playbooks.d/vpn-tinc/playbook.bash b/playbooks.d/vpn-tinc/playbook.bash
index f9c8dd5..9cce9a6 100644
--- a/playbooks.d/vpn-tinc/playbook.bash
+++ b/playbooks.d/vpn-tinc/playbook.bash
@@ -84,8 +84,15 @@ playbook_add()
;;
esac
- svc enable "tinc"
- svc start "tinc"
+ case "${BASHTARD_PLATFORM[init]}" in
+ systemd)
+ systemctl enable --now tinc@tyilnet.service
+ ;;
+ *)
+ svc enable "tinc"
+ svc start "tinc"
+ ;;
+ esac
}
playbook_sync()
@@ -109,13 +116,27 @@ playbook_sync()
[[ "$BASHTARD_COMMAND" == "add" ]] && return
- svc reload "tinc"
+ case "${BASHTARD_PLATFORM[init]}" in
+ systemd)
+ systemctl reload tinc@tyilnet.service
+ ;;
+ *)
+ svc reload "tinc"
+ ;;
+ esac
}
playbook_del()
{
- svc stop "tinc"
- svc disable "tinc"
+ case "${BASHTARD_PLATFORM[init]}" in
+ systemd)
+ systemctl disable --now tinc@tyilnet.service
+ ;;
+ *)
+ svc stop "tinc"
+ svc disable "tinc"
+ ;;
+ esac
pkg uninstall "tinc"
--
cgit v1.1