diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd7f5f..9ff225f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,10 @@ The `./gravity-sync.sh restore` process completely revamped: - The prompts are clearer and more consistent with Gravity Sync script styling. - Importantly, lack of backup files in an element will not cause the restoration to fail. +#### 3.2.3 + +- Cleanup of the error message screen when an invalid command is run (ex: `./gravity-sync.sh wtf`) + ## 3.1 ### The Container Release diff --git a/VERSION b/VERSION index acf9bf0..06eda28 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.2 \ No newline at end of file +3.2.3 \ No newline at end of file diff --git a/gravity-sync.sh b/gravity-sync.sh index e187ac5..9bb50a1 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -3,7 +3,7 @@ SCRIPT_START=$SECONDS # GRAVITY SYNC BY VMSTAN ##################### PROGRAM='Gravity Sync' -VERSION='3.2.2' +VERSION='3.2.3' # For documentation or downloading updates visit https://github.com/vmstan/gravity-sync # Requires Pi-Hole 5.x or higher already be installed, for help visit https://pi-hole.net diff --git a/includes/gs-colors.sh b/includes/gs-colors.sh index 10eff5f..f7e7888 100644 --- a/includes/gs-colors.sh +++ b/includes/gs-colors.sh @@ -57,3 +57,10 @@ function echo_need { function echo_lines { echo -e "========================================================" } + +### Lines +function echo_blank { + echo -e "" +} + + diff --git a/includes/gs-exit.sh b/includes/gs-exit.sh index e4fcf44..014d3ce 100644 --- a/includes/gs-exit.sh +++ b/includes/gs-exit.sh @@ -7,7 +7,14 @@ ## No Changes Made function exit_nochange { SCRIPT_END=$SECONDS - MESSAGE="${PROGRAM} ${TASKTYPE} Aborting ($((SCRIPT_END-SCRIPT_START)) seconds)" + + if [ "${TASKTYPE}" == "" ] + then + MESSAGE="${PROGRAM} Aborting ($((SCRIPT_END-SCRIPT_START)) seconds)" + else + MESSAGE="${PROGRAM} ${TASKTYPE} Aborting ($((SCRIPT_END-SCRIPT_START)) seconds)" + fi + echo_info exit 0 } @@ -15,7 +22,14 @@ function exit_nochange { ## Changes Made function exit_withchange { SCRIPT_END=$SECONDS - MESSAGE="${PROGRAM} ${TASKTYPE} Completed ($((SCRIPT_END-SCRIPT_START)) seconds)" + + if [ "${TASKTYPE}" == "" ] + then + MESSAGE="${PROGRAM} Completed ($((SCRIPT_END-SCRIPT_START)) seconds)" + else + MESSAGE="${PROGRAM} ${TASKTYPE} Completed ($((SCRIPT_END-SCRIPT_START)) seconds)" + fi + echo_info exit 0 } @@ -24,25 +38,27 @@ function exit_withchange { function list_gs_arguments { echo -e "Usage: $0 [options]" echo -e "Example: '$0 pull'" - echo -e "" + echo_lines echo -e "Setup Options:" - echo -e " ${YELLOW}config${NC} Create a new ${CONFIG_FILE} file" - echo -e " ${YELLOW}automate${NC} Add a scheduled pull task to crontab" - echo -e " ${YELLOW}update${NC} Update ${PROGRAM} to the latest version" - echo -e " ${YELLOW}version${NC} Display installed version of ${PROGRAM}" - echo -e " ${YELLOW}sudo${NC} Configure passwordless sudo for current user" - echo -e "" + echo -e " ${YELLOW}config${NC} Creates a new ${PROGRAM} configuration file" + echo -e " ${YELLOW}automate${NC} Schedules the ${PROGRAM} replication task using crontab" + echo -e " ${YELLOW}version${NC} Shows the installed version of ${PROGRAM} and check for updates" + echo -e " ${YELLOW}update${NC} Upgrades ${PROGRAM} to the latest available version using Git" + echo -e " ${YELLOW}dev${NC} Sets update command to use a development version of ${PROGRAM}" + echo -e " ${YELLOW}sudo${NC} Configures passwordless sudo for current user" + echo_blank echo -e "Replication Options:" - echo -e " ${YELLOW}smart${NC} Detect changes on each side and bring them together" - echo -e " ${YELLOW}pull${NC} Force remote configuration changes to this server" - echo -e " ${YELLOW}push${NC} Force local configuration made on this server back" - echo -e " ${YELLOW}restore${NC} Restore the ${GRAVITY_FI} on this server" - echo -e " ${YELLOW}backup${NC} Backup the ${GRAVITY_FI} on this server" - echo -e " ${YELLOW}compare${NC} Just check for differences" - echo -e "" + echo -e " ${YELLOW}smart${NC} Detects Pi-hole changes on primary and secondary and then combines them" + echo -e " ${YELLOW}pull${NC} Brings the remote Pi-hole configuration to this server" + echo -e " ${YELLOW}push${NC} Sends the local Pi-hole configuration to the primary" + echo -e " ${YELLOW}compare${NC} Just checks for Pi-hole differences at each side without making changes" + echo -e " ${YELLOW}restore${NC} Restores the Pi-hole configuration on this server" + echo -e " ${YELLOW}backup${NC} Just backs up the Pi-hole on this server" + echo_blank echo -e "Debug Options:" - echo -e " ${YELLOW}logs${NC} Show recent successful replication jobs" - echo -e " ${YELLOW}cron${NC} Display output of last crontab execution" - echo -e "" + echo -e " ${YELLOW}logs${NC} Shows the recent successful replication jobs/times" + echo -e " ${YELLOW}cron${NC} Displays the output of last crontab execution" + echo -e " ${YELLOW}info${NC} Shows information about the current configuration" + echo_lines exit_nochange } \ No newline at end of file diff --git a/prep/gs-install.sh b/prep/gs-install.sh index 9131c22..34056e8 100644 --- a/prep/gs-install.sh +++ b/prep/gs-install.sh @@ -28,7 +28,7 @@ echo -e "========================================================" echo -e "${YELLOW}Gravity Sync by ${BLUE}@vmstan${YELLOW} - Online Installation${NC}" echo -e "${CYAN}https://github.com/vmstan/gravity-sync${NC}" echo -e "========================================================" -# echo -e "Initalizing Short Range Sensors" +echo -e "[${GREEN}✓${NC}] Checking Short Range Sensors" # Check Root echo -e "[${YELLOW}i${NC}] ${YELLOW}Validating System Authorization${NC}"