Fix: Use 'return' instead of 'exit' in launcher.sh since it's sourced
Issue: launcher.sh uses 'exit 0' when user selects cleanup option. Since launcher.sh is sourced (not executed), 'exit' terminates the entire shell abruptly, preventing run.sh cleanup code from executing and crashing the SSH connection. Solution: Change 'exit 0' to 'return 0' so launcher.sh returns control to run.sh for proper cleanup handling. This allows: - run.sh to catch the return code - Cleanup flag to be processed - Toolkit directory to be deleted properly - Shell to remain active and return cleanly to user
This commit is contained in:
+1
-1
@@ -676,7 +676,7 @@ main() {
|
|||||||
echo -e "${GREEN}Thanks for using Server Management Toolkit!${NC}"
|
echo -e "${GREEN}Thanks for using Server Management Toolkit!${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
exit 0
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${RED}Invalid option${NC}"
|
echo -e "${RED}Invalid option${NC}"
|
||||||
|
|||||||
Reference in New Issue
Block a user