diff --git a/CHANGELOG.md b/CHANGELOG.md index 152cb4e..b1a4128 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,6 +130,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - install_script() function handles installation with overwrite confirmation - uninstall_script() function removes command but keeps configurations - Command-line argument parsing before main() execution + - **Menu option 7: "Install as system command"** - Available in main menu + - **Post-installation prompt** - Automatically asks if you want to install as system command after initial setup + - Detects if already installed (skips prompt if /usr/local/bin/PBSClientTool exists) - **Automatic connection testing at startup** - All configured targets are automatically tested when script starts - Quick authentication check (5 second timeout per target) diff --git a/pbs-client-installer.sh b/pbs-client-installer.sh index c83769b..4f96e8d 100755 --- a/pbs-client-installer.sh +++ b/pbs-client-installer.sh @@ -2161,8 +2161,9 @@ main() { echo " 4) Delete target" echo " 5) Run backup now (select target)" echo " 6) Reinstall PBS client" - echo " 7) Exit" - ACTION=$(prompt "Select option [1-7]" "7") + echo " 7) Install as system command" + echo " 8) Exit" + ACTION=$(prompt "Select option [1-8]" "8") case "$ACTION" in 1) @@ -2240,6 +2241,9 @@ main() { log "PBS client reinstalled successfully" ;; 7) + install_script + ;; + 8) info "Exiting" exit 0 ;; @@ -2271,6 +2275,22 @@ main() { echo log "First target '$TARGET_NAME' created successfully!" + echo + + # Offer to install as system command + if [ ! -f "$INSTALL_PATH" ]; then + echo + info "Would you like to install PBSClientTool as a system command?" + echo "This will allow you to run 'sudo PBSClientTool' from anywhere." + echo + INSTALL_CHOICE=$(prompt "Install as system command? (yes/no)" "yes") + + if [ "$INSTALL_CHOICE" = "yes" ]; then + echo + install_script + fi + fi + echo info "You can add more targets by running this script again." exit 0 @@ -2311,6 +2331,22 @@ main() { echo log "First target '$TARGET_NAME' created successfully!" + echo + + # Offer to install as system command + if [ ! -f "$INSTALL_PATH" ]; then + echo + info "Would you like to install PBSClientTool as a system command?" + echo "This will allow you to run 'sudo PBSClientTool' from anywhere." + echo + INSTALL_CHOICE=$(prompt "Install as system command? (yes/no)" "yes") + + if [ "$INSTALL_CHOICE" = "yes" ]; then + echo + install_script + fi + fi + echo info "You can add more targets by running this script again." exit 0