* Add info to error output

* Tabs

* Lines

* Words

* ``

* Wrods

* Clean up spacing for tasktype

* Checkbox

* 3.2.3

* Changes

* THEN
This commit is contained in:
Michael Stanclift 2021-01-12 10:38:40 -06:00 committed by GitHub
parent abf841ae53
commit 5b125e0776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 22 deletions

View File

@ -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

View File

@ -1 +1 @@
3.2.2
3.2.3

View File

@ -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

View File

@ -57,3 +57,10 @@ function echo_need {
function echo_lines {
echo -e "========================================================"
}
### Lines
function echo_blank {
echo -e ""
}

View File

@ -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
}

View File

@ -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}"