@@ -679,6 +679,21 @@ show_server_logs() {
679679 fi
680680}
681681
682+ # app logs
683+ post_installation_logs () {
684+ log " INFO" " Press Ctrl+C to exit."
685+ echo " "
686+ echo " --- post installation Logs ---"
687+ echo " "
688+ echo " log file: $FLASK_LOG_FILE "
689+ if [ -f " $FLASK_LOG_FILE " ]; then
690+ log " Server log file: $FLASK_LOG_FILE "
691+ tail -100f " $FLASK_LOG_FILE "
692+ else
693+ log " No logs found at $FLASK_LOG_FILE ."
694+ fi
695+ }
696+
682697# installation logs
683698show_installer_logs () {
684699 log " INFO" " Press Ctrl+C to exit."
@@ -768,53 +783,47 @@ fix() {
768783}
769784
770785# Display help
771- show_help () {
772- echo " $APP_NAME Installer"
786+ display_help () {
787+ echo " $APP_NAME Installer and Manager"
788+ echo " "
789+ echo " Usage: $EXECUTABLE_APP_NAME [command]"
773790 echo " "
774- echo " Usage: $EXECUTABLE_APP_NAME [options]"
791+ echo " Commands:"
792+ echo " --install Install $APP_NAME and configure all dependencies."
793+ echo " Sets up the environment and starts the application."
775794 echo " "
776- echo " Options:"
777- echo " --install Install $APP_NAME and set up all necessary dependencies."
778- echo " This will configure the environment and start the application."
795+ echo " --uninstall Completely remove $APP_NAME and all related files."
779796 echo " "
780- echo " --uninstall Uninstall $APP_NAME completely ."
781- echo " This will remove the application and all associated files ."
797+ echo " --repair Repair $APP_NAME installation issues ."
798+ echo " Fixes any installation errors and restarts the server ."
782799 echo " "
783- echo " --fix Fix the $APP_NAME installation errors."
784- echo " This will fix any issues with the installation and restart the server."
785- echo " "
786- echo " --restore Restore $APP_NAME from a backup."
787- echo " Use this option to recover data or settings from a previous backup."
800+ echo " --restore-backup Restore $APP_NAME from a backup."
801+ echo " Recover data or settings from a previous backup."
788802 echo " "
789- echo " --load-test Start Locust load testing for $APP_NAME ."
790- echo " This will initiate performance testing to simulate multiple users ."
803+ echo " --run- load-test Perform load testing using Locust for $APP_NAME ."
804+ echo " Simulates multiple users to test application performance ."
791805 echo " "
792- echo " --status Check the status of $APP_NAME installation ."
793- echo " Displays whether $APP_NAME is installed, running, or if there are any issues."
806+ echo " --check- status Display the current status of $APP_NAME ."
807+ echo " Shows whether the application is installed, running, or encountering issues."
794808 echo " "
795- echo " --health-check Perform a health check on $HOST_URL ."
796- echo " Verifies that the application is running correctly and responding to requests ."
809+ echo " --perform- health-check Check the health of $APP_NAME at $HOST_URL ."
810+ echo " Ensures the application is running properly and responding."
797811 echo " "
798- echo " --clean-backups Clean up all backups of $APP_NAME ."
799- echo " This will delete all saved backup files to free up space."
812+ echo " --clean-old- backups Remove all $APP_NAME backup files ."
813+ echo " Deletes stored backups to free up disk space."
800814 echo " "
801- echo " --logs Show server logs for $APP_NAME ."
802- echo " Displays the latest server logs, which can help in troubleshooting issues."
803- echo " Press Ctrl+C to exit the log viewing session."
815+ echo " --view-server-logs Display recent server logs for $APP_NAME ."
816+ echo " Helps diagnose server issues. Use Ctrl+C to exit."
804817 echo " "
805- echo " --installation-logs Show installer logs for $APP_NAME ."
806- echo " Displays the logs generated during the installation process."
807- echo " Press Ctrl+C to exit the log viewing session."
818+ echo " --view-install-logs Show installation logs for $APP_NAME ."
819+ echo " Provides details on the installation process. Use Ctrl+C to exit."
808820 echo " "
809- echo " --server-stop Stop the $APP_NAME server."
810- echo " This will stop the running server instance."
821+ echo " --stop-server Stop the currently running $APP_NAME server."
811822 echo " "
812- echo " --update-dependencies"
813- echo " Update the dependencies of the $APP_NAME ."
814- echo " This will update the dependencies of the application."
823+ echo " --update-dependencies Update $APP_NAME dependencies."
824+ echo " Ensures all dependencies are up-to-date."
815825 echo " "
816- echo " --help Display this help message."
817- echo " Shows information about all available options and how to use them."
826+ echo " --help Display this help message with available commands."
818827}
819828
820829
@@ -823,38 +832,35 @@ for arg in "$@"; do
823832 case $arg in
824833 --install) ACTION=" install" ;;
825834 --uninstall) ACTION=" uninstall" ;;
826- --restore ) ACTION=" restore " ;;
827- --load-test ) ACTION=" load_test " ;;
828- --status ) ACTION=" check_status " ;;
829- --health- check) ACTION=" health_check " ;;
830- --clean-backups ) ACTION=" cleanup_backups " ;;
831- --logs) show_server_logs ; exit 0 ;;
832- --installation- logs) show_installer_logs ; exit 0 ;;
833- --server-stop) stop_server ; exit 0 ;;
834- --fix) fix ; exit 0 ;;
835- --update-dependencies) update_dependencies; exit 0 ;;
836- --help) show_help ; exit 0 ;;
837- * ) echo " Unknown option: $arg " ; show_help ; exit 1 ;;
835+ --repair ) ACTION=" fix " ;;
836+ --restore-backup ) ACTION=" restore " ;;
837+ --run-load-test ) ACTION=" load_test " ;;
838+ --check-status ) ACTION=" check_status " ;;
839+ --perform-health-check ) ACTION=" health_check " ;;
840+ --clean-old-backups) ACTION= " cleanup_backups " ;;
841+ --view-server- logs) ACTION= " logs " ;;
842+ --view-install-logs) ACTION= " installation-logs " ;;
843+ --stop-server) ACTION= " stop_server " ;;
844+ --update-dependencies) ACTION= " update_dependencies" ;;
845+ --help) ACTION= " help " ;;
846+ * ) echo " Unknown option: $arg " ; ACTION= " help " ; ;;
838847 esac
839848done
840849
841850# Execute based on the action specified
842851case $ACTION in
843852 install) install ;;
844853 uninstall) uninstall ;;
854+ fix) fix ;;
845855 restore) restore ;;
846856 load_test) load_test ;;
847- install_latest) install_latest ;;
848857 check_status) check_status ;;
849858 health_check) health_check ;;
850859 cleanup_backups) cleanup_backups ;;
851- stop_server) stop_server ;;
852860 logs) show_server_logs ;;
853861 installation-logs) show_installer_logs ;;
854- fix) fix ;;
862+ stop_server) stop_server ;;
855863 update_dependencies) update_dependencies ;;
864+ help) display_help ;;
856865 * ) echo " No action specified. Use --help for usage information." ;;
857866esac
858-
859- log " INFO" " SystemGuard Installer script completed."
860- log " INFO" " ----------------------------------------"
0 commit comments