Skip to content

Commit c3fa355

Browse files
committed
Fixed bug, exit code is wrong when running under different user than root
1 parent fb3c64b commit c3fa355

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

control.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ function redirect_user() { # Params: USER
169169
if user_permitted "${1}"; then
170170
if ! correct_user_running; then
171171
sudo -u ${1} ${FULL_COMMAND_LINE}
172-
unset -v FULL_COMMAND_LINE
173-
return $?
172+
return ${?}
174173
fi;
175174
fi;
176175
fi;
@@ -626,7 +625,7 @@ if ! redirect_processed; then
626625
if user_exists "${EXECUTING_USER}"; then
627626
echo -e "${COLOR_YELLOW}${COLOR_BOLD}Trying to change the user authority...${COLOR_RESET}"
628627
redirect_user "${EXECUTING_USER}"
629-
script_end $?
628+
script_end ${?}
630629
else
631630
echo -e "${COLOR_RED}${COLOR_BOLD}User doesn't exists, given in Variable 'EXECUTING_USER'!${COLOR_RESET}"
632631
script_end 1

0 commit comments

Comments
 (0)