4
0
Эх сурвалжийг харах

proper exit (fix opt running after uf)

UltimateByte 9 жил өмнө
parent
commit
e51746e5b1

+ 2 - 3
lgsm/functions/core_getopt.sh

@@ -174,12 +174,11 @@ for i in "${optcommands[@]}"; do
 				if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then
 					# Run command
 					${currentopt[index+1]}
+					core_exit.sh
 					break
 				fi
 			done
 		done
-		break
-		core_exit.sh
 	fi
 done
 
@@ -187,4 +186,4 @@ done
 echo -e "${red}Unknown command${default}: $0 ${getopt}"
 exitcode=2
 fn_opt_usage
-core_exit.sh
+core_exit.sh