mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-19 03:16:58 +02:00
Enhance up command (#133)
* 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>
This commit is contained in:
30
release_files/pre_remove.sh
Normal file
30
release_files/pre_remove.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/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
|
Reference in New Issue
Block a user