gravity-sync/includes/gs-update.sh

306 lines
7.7 KiB
Bash
Raw Normal View History

# GRAVITY SYNC BY VMSTAN #####################
# gs-update.sh ###############################
# For documentation or downloading updates visit https://github.com/vmstan/gravity-sync
# This code is called from the main gravity-sync.sh file and should not execute directly!
## Master Branch
function update_gs {
2020-12-31 02:45:47 +00:00
if [ -f "${LOCAL_FOLDR}/dev" ]
then
source ${LOCAL_FOLDR}/dev
else
BRANCH='origin/master'
fi
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
if [ "$BRANCH" != "origin/master" ]
then
MESSAGE="Pulling from ${BRANCH}"
echo_info
fi
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
GIT_CHECK=$(git status | awk '{print $1}')
if [ "$GIT_CHECK" == "fatal:" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Updater usage requires GitHub installation"
2020-12-31 02:45:47 +00:00
echo_warn
exit_nochange
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Downloading updates via GitHub"
2020-12-31 02:45:47 +00:00
echo_stat
git fetch --all >/dev/null 2>&1
2020-12-31 02:49:54 +00:00
error_validate
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Deploying the latest ${PROGRAM} code"
2020-12-31 02:45:47 +00:00
echo_stat
git reset --hard ${BRANCH} >/dev/null 2>&1
2020-12-31 02:49:54 +00:00
error_validate
2020-12-31 02:45:47 +00:00
fi
}
## Show Version
function show_version {
echo_lines
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${PURPLE}${PROGRAM}${NC} for Pi-hole"
2020-12-31 02:45:47 +00:00
echo_info
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
MESSAGE="${BLUE}https://github.com/vmstan/gravity-sync${NC}"
echo_info
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
if [ -f ${LOCAL_FOLDR}/dev ]
then
DEVVERSION="dev"
elif [ -f ${LOCAL_FOLDR}/beta ]
2020-12-31 02:49:54 +00:00
then
2020-12-31 02:45:47 +00:00
DEVVERSION="beta"
else
DEVVERSION=""
fi
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Running version: ${GREEN}${VERSION}${NC} ${DEVVERSION}"
2020-12-31 02:45:47 +00:00
echo_info
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
GITVERSION=$(curl -sf https://raw.githubusercontent.com/vmstan/gravity-sync/master/VERSION)
if [ -z "$GITVERSION" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Latest version: ${RED}Unknown${NC}"
2020-12-31 02:45:47 +00:00
else
if [ "$GITVERSION" != "$VERSION" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Update available: ${RED}${GITVERSION}${NC}"
2020-12-31 02:45:47 +00:00
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Latest version: ${GREEN}${GITVERSION}${NC}"
2020-12-31 02:45:47 +00:00
fi
fi
echo_info
echo_lines
}
2020-10-23 14:31:09 +00:00
function show_info() {
if [ -f ${LOCAL_FOLDR}/dev ]
then
DEVVERSION="-dev"
elif [ -f ${LOCAL_FOLDR}/beta ]
then
DEVVERSION="-beta"
else
DEVVERSION=""
fi
echo_lines
echo -e "${YELLOW}Local Software Versions${NC}"
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
echo -e "${PURPLE}Gravity Sync${NC} ${VERSION}${DEVVERSION}"
echo -e "${BLUE}Pi-hole${NC}"
if [ "${PH_IN_TYPE}" == "default" ]
then
pihole version
elif [ "${PH_IN_TYPE}" == "docker" ]
then
sudo docker exec -it pihole pihole -v
elif [ "${PH_IN_TYPE}" == "podman" ]
then
sudo podman exec -it pihole pihole -v
fi
uname -srm
echo -e "bash $BASH_VERSION"
ssh -V
rsync --version | grep version
SQLITE3_VERSION=$(sqlite3 --version)
echo -e "sqlite3 ${SQLITE3_VERSION}"
sudo --version | grep "Sudo version"
git --version
if hash docker 2>/dev/null
then
docker --version
fi
if hash podman 2>/dev/null
then
podman --version
fi
echo -e ""
echo -e "${YELLOW}Local/Secondary Instance Settings${NC}"
echo -e "Local Hostname: $HOSTNAME"
2020-12-31 02:45:47 +00:00
echo -e "Local Pi-hole Type: ${PH_IN_TYPE}"
echo -e "Local Pi-hole Config Directory: ${PIHOLE_DIR}"
echo -e "Local DNSMASQ Config Directory: ${DNSMAQ_DIR}"
echo -e "Local Gravity Sync Directory: ${LOCAL_FOLDR}"
if [ "${PH_IN_TYPE}" == "default" ]
then
echo -e "Local Pi-hole Binary Directory: ${PIHOLE_BIN}"
elif [ "${PH_IN_TYPE}" == "docker" ]
then
echo -e "Local Pi-hole Container Name: ${DOCKER_CON}"
echo -e "Local Docker Binary Directory: ${DOCKER_BIN}"
elif [ "${PH_IN_TYPE}" == "podman" ]
then
echo -e "Local Pi-hole Container Name: ${DOCKER_CON}"
echo -e "Local Podman Binary Directory: ${PODMAN_BIN}"
fi
echo -e "Local File Owner Settings: ${FILE_OWNER}"
if [ ${SKIP_CUSTOM} == '0' ]
then
echo -e "DNS Replication: Enabled (default)"
elif [ ${SKIP_CUSTOM} == '1' ]
then
echo -e "DNS Replication: Disabled (custom)"
else
echo -e "DNS Replication: Invalid Configuration"
fi
if [ ${INCLUDE_CNAME} == '1' ]
then
echo -e "CNAME Replication: Enabled (custom)"
elif [ ${INCLUDE_CNAME} == '0' ]
then
echo -e "CNAME Replication: Disabled (default)"
else
echo -e "CNAME Replication: Invalid Configuration"
fi
if [ ${VERIFY_PASS} == '1' ]
then
echo -e "Verify Operations: Enabled (default)"
elif [ ${VERIFY_PASS} == '0' ]
then
echo -e "Verify Operations: Disabled (custom)"
else
echo -e "Verify Operations: Invalid Configuration"
fi
if [ ${PING_AVOID} == '0' ]
then
echo -e "Ping Test: Enabled (default)"
elif [ ${PING_AVOID} == '1' ]
then
echo -e "Ping Test: Disabled (custom)"
else
echo -e "Ping Test: Invalid Configuration"
fi
if [ ${BACKUP_RETAIN} == '7' ]
then
echo -e "Backup Retention: 7 days (default)"
elif [ ${BACKUP_RETAIN} == '1' ]
then
echo -e "Backup Retention: 1 day (custom)"
else
echo -e "Backup Retention: ${BACKUP_RETAIN} days (custom)"
fi
BACKUP_FOLDER_SIZE=$(du -h ${LOCAL_FOLDR}/${BACKUP_FOLD} | sed 's/\s.*$//')
echo -e "Backup Folder Size: ${BACKUP_FOLDER_SIZE}"
2020-12-31 02:45:47 +00:00
echo -e ""
echo -e "${YELLOW}Remote/Primary Instance Settings${NC}"
echo -e "Remote Hostname/IP: ${REMOTE_HOST}"
echo -e "Remote Username: ${REMOTE_USER}"
2020-12-31 02:45:47 +00:00
echo -e "Remote Pi-hole Type: ${RH_IN_TYPE}"
echo -e "Remote Pi-hole Config Directory: ${RIHOLE_DIR}"
echo -e "Remote DNSMASQ Config Directory: ${RNSMAQ_DIR}"
if [ "${RH_IN_TYPE}" == "default" ]
then
echo -e "Remote Pi-hole Binary Directory: ${RIHOLE_BIN}"
elif [ "${RH_IN_TYPE}" == "docker" ]
then
echo -e "Remote Pi-hole Container Name: ${ROCKER_CON}"
echo -e "Remote Docker Binary Directory: ${ROCKER_BIN}"
elif [ "${RH_IN_TYPE}" == "podman" ]
then
echo -e "Remote Pi-hole Container Name: ${ROCKER_CON}"
echo -e "Remote Podman Binary Directory: ${RODMAN_BIN}"
fi
echo -e "Remote File Owner Settings: ${RILE_OWNER}"
echo_lines
2020-10-23 14:31:09 +00:00
}
## Devmode Task
function task_devmode {
2020-12-31 02:45:47 +00:00
TASKTYPE='DEV'
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${MESSAGE}: ${TASKTYPE}"
2020-12-31 02:45:47 +00:00
echo_good
if [ -f ${LOCAL_FOLDR}/dev ]
then
MESSAGE="Disabling ${TASKTYPE}"
echo_stat
rm -f ${LOCAL_FOLDR}/dev
2020-12-31 02:49:54 +00:00
error_validate
2020-12-31 02:45:47 +00:00
elif [ -f ${LOCAL_FOLDR}/beta ]
then
MESSAGE="Disabling BETA"
echo_stat
rm -f ${LOCAL_FOLDR}/beta
2020-12-31 02:49:54 +00:00
error_validate
2020-12-31 02:45:47 +00:00
MESSAGE="Enabling ${TASKTYPE}"
echo_stat
touch ${LOCAL_FOLDR}/dev
2020-12-31 02:49:54 +00:00
error_validate
2020-12-31 02:45:47 +00:00
else
MESSAGE="Enabling ${TASKTYPE}"
echo_stat
touch ${LOCAL_FOLDR}/dev
2020-12-31 02:49:54 +00:00
error_validate
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Checking available branches"
2020-12-31 02:45:47 +00:00
echo_stat
git fetch --all >/dev/null 2>&1
2020-12-31 02:49:54 +00:00
error_validate
2020-12-31 02:45:47 +00:00
git branch -r
2020-12-31 02:49:54 +00:00
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="Select GitHub branch to update against"
2020-12-31 02:45:47 +00:00
echo_need
read INPUT_BRANCH
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
echo -e "BRANCH='${INPUT_BRANCH}'" >> ${LOCAL_FOLDR}/dev
fi
update_gs
exit_withchange
}
## Update Task
function task_update {
2020-12-31 02:45:47 +00:00
TASKTYPE='UPDATE'
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${MESSAGE}: ${TASKTYPE}"
2020-12-31 02:45:47 +00:00
echo_good
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
dbclient_warning
update_gs
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
exit_withchange
}
## Version Task
function task_version {
2020-12-31 02:45:47 +00:00
TASKTYPE='VERSION'
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${MESSAGE}: ${TASKTYPE}"
2020-12-31 02:45:47 +00:00
echo_good
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
show_version
exit_nochange
2020-10-23 14:23:53 +00:00
}
## Info Task
2020-10-23 14:31:09 +00:00
function task_info() {
2020-12-31 02:45:47 +00:00
TASKTYPE='INFO'
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${MESSAGE}: ${TASKTYPE}"
2020-12-31 02:45:47 +00:00
echo_good
show_info
exit_nochange
}