Squashed service_type bug

This commit is contained in:
2022-01-12 12:56:28 -05:00
parent 01e8f3a488
commit d8c452eb4d

View File

@@ -906,9 +906,7 @@ setServiceVars() {
return 1 return 1
fi fi
echo "$SERVICE_TYPE" if [[ "$service_type" == "system" ]]; then
if [[ "$SERVICE_TYPE" == "system" ]]; then
service_dir="$service_system_dir" service_dir="$service_system_dir"
EXEC_USER="root" EXEC_USER="root"
systemctl_reload_cmd(){ sudo systemctl daemon-reload; } systemctl_reload_cmd(){ sudo systemctl daemon-reload; }
@@ -916,7 +914,7 @@ setServiceVars() {
systemctl_disable_cmd(){ sudo systemctl disable --now "$@"; } systemctl_disable_cmd(){ sudo systemctl disable --now "$@"; }
systemctl_is_enabled_cmd(){ sudo systemctl is-enabled -q "$@"; } systemctl_is_enabled_cmd(){ sudo systemctl is-enabled -q "$@"; }
systemctl_is_active_cmd(){ sudo systemctl is-active -q "$@"; } systemctl_is_active_cmd(){ sudo systemctl is-active -q "$@"; }
elif [[ "$SERVICE_TYPE" == "user" ]]; then elif [[ "$service_type" == "user" ]]; then
service_dir="$service_user_dir" service_dir="$service_user_dir"
EXEC_USER="$USER" EXEC_USER="$USER"
systemctl_reload_cmd(){ systemctl --user daemon-reload; } systemctl_reload_cmd(){ systemctl --user daemon-reload; }
@@ -1506,7 +1504,6 @@ main() {
if ! setServiceVars "$service"; then if ! setServiceVars "$service"; then
continue continue
fi fi
if ! "service_$service"; then if ! "service_$service"; then
if [[ $? -eq 127 ]]; then if [[ $? -eq 127 ]]; then
err "Service $service does not exist, check your service name" err "Service $service does not exist, check your service name"