Skip to content

Commit

Permalink
Merge pull request #226 from atsign-foundation/xavier-patches-2
Browse files Browse the repository at this point in the history
fix: sshnpd updater patches
  • Loading branch information
XavierChanth authored Jun 28, 2023
2 parents fbfa8ec + 59d83f4 commit 21ba682
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions scripts/install_sshnpd
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,7 @@ setup_service() {

# used to restart the service after an update
restart_service() {
SERVICE_LIST_FILE="$HOME_PATH/.$BINARY_NAME/.service_list";
while read -r SERVICE;
do
SERVICE=$(echo "$SERVICE" | cut -f 1 -d ' ');
killall -qu "$SSHNP_USER" "$SERVICE";
done < "$SERVICE_LIST_FILE";
killall -q -u "$SSHNP_USER" -r "$BINARY_NAME$"
}

post_install() {
Expand All @@ -280,20 +275,15 @@ main () {

setup_main_binaries

case "$SSHNP_OP" in
install)
setup_service
;;
update)
restart_service
;;
*)
echo "Invalid operation: $SSHNP_OP";
exit 0;
;;
esac
if [ "$SSHNP_OP" = 'install' ]; then
setup_service
fi

post_install

if [ "$SSHNP_OP" = 'update' ]; then
restart_service
fi
}

parse_args "$@";
Expand Down

0 comments on commit 21ba682

Please sign in to comment.