diff options
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" |