diff options
author | Patrick Spek <p.spek@tyil.nl> | 2022-08-03 13:48:31 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2022-08-03 13:49:18 +0200 |
commit | 2c08891979ac14d5a464e4c8908ed7fbfe024259 (patch) | |
tree | 4a1fa4db1b3b35b39240b1d1b6485f4bd5623289 /playbooks.d/vpn-tinc | |
parent | d1800e3cc5a86172127f73fc04ff2cd00eef4b5b (diff) |
Improve systemd support for tinc playbook
Diffstat (limited to 'playbooks.d/vpn-tinc')
-rw-r--r-- | playbooks.d/vpn-tinc/playbook.bash | 31 |
1 files changed, 26 insertions, 5 deletions
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" |