mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-19 16:56:39 +00:00
* move setup-key to root command * up will check login and start service * update tests to reflect new UP capabilities * display client IP * removed unused argument * install service if not installed * update post-install and add pre remove script * improve log messages * handle service status failures and install service when needed * removing unused files * update documentation and description * add version command * update service lib version * using lib constant for not installed services * match version from goreleaser * fix: graceful shutdown * stop only if service is running * add logs initialization to service controller commands Co-authored-by: braginini <bangvalo@gmail.com>
30 lines
786 B
Bash
30 lines
786 B
Bash
#!/bin/sh
|
|
# decide if we should use systemd or init/upstart
|
|
use_systemctl="True"
|
|
systemd_version=0
|
|
if ! command -V systemctl >/dev/null 2>&1; then
|
|
use_systemctl="False"
|
|
else
|
|
systemd_version=$(systemctl --version | head -1 | sed 's/systemd //g')
|
|
fi
|
|
|
|
printf "\033[32m Pre uninstall\033[0m\n"
|
|
|
|
if [ "${use_systemctl}" = "True" ]; then
|
|
printf "\033[32m Stopping the service\033[0m\n"
|
|
systemctl stop wiretrustee
|
|
|
|
if [ -e /lib/systemd/system/wiretrustee.service ]; then
|
|
rm -f /lib/systemd/system/wiretrustee.service
|
|
systemctl daemon-reload
|
|
fi
|
|
|
|
fi
|
|
printf "\033[32m Uninstalling the service\033[0m\n"
|
|
/usr/local/bin/wiretrustee service uninstall
|
|
|
|
|
|
if [ "${use_systemctl}" = "True" ]; then
|
|
printf "\n\033[32m running daemon reload\033[0m\n"
|
|
systemctl daemon-reload
|
|
fi |