diff --git a/scripts/create-latest-svc.sh b/scripts/create-latest-svc.sh index 17da08bff..1971fda8a 100755 --- a/scripts/create-latest-svc.sh +++ b/scripts/create-latest-svc.sh @@ -126,5 +126,10 @@ sudo -E -u ${svc_user} ./config.sh --unattended --url $runner_url --token $RUNNE #--------------------------------------- echo echo "Configuring as a service ..." -./svc.sh install ${svc_user} -./svc.sh start +prefix="" +if [ "${runner_plat}" == "linux" ]; then + prefix="sudo " +fi + +${prefix}./svc.sh install ${svc_user} +${prefix}./svc.sh start diff --git a/scripts/remove-svc.sh b/scripts/remove-svc.sh index e588d6904..1c95bfb52 100755 --- a/scripts/remove-svc.sh +++ b/scripts/remove-svc.sh @@ -62,6 +62,6 @@ echo $REMOVE_TOKEN echo echo "Uninstall the service ..." pushd ./runner -./svc.sh stop -./svc.sh uninstall +${prefix}./svc.sh stop +${prefix}./svc.sh uninstall ./config.sh remove --token $REMOVE_TOKEN