Add alias for more functions

This commit is contained in:
Michael Stanclift 2020-06-02 10:36:59 -05:00
parent cbbf18bb60
commit 2d07e6dbd9
2 changed files with 81 additions and 49 deletions

View File

@ -14,6 +14,7 @@
#### 1.7.7 #### 1.7.7
- `config` function will attempt to ping remote host to validate network connection, can by bypassed by adding `PING_AVOID='1'` to your `gravity-sync.conf` file. - `config` function will attempt to ping remote host to validate network connection, can by bypassed by adding `PING_AVOID='1'` to your `gravity-sync.conf` file.
- Changes some [INFO] messages to [WARN] where approprate - Changes some [INFO] messages to [WARN] where approprate
- Adds aliases for more GS functions
#### 1.7.6 #### 1.7.6
- Detects `dbclient` install as alternative to OpenSSH Client. - Detects `dbclient` install as alternative to OpenSSH Client.

View File

@ -1075,6 +1075,7 @@ function show_version {
## Automate Task ## Automate Task
function task_automate { function task_automate {
TASKTYPE='AUTOMATE' TASKTYPE='AUTOMATE'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
import_gs import_gs
@ -1136,6 +1137,50 @@ function task_automate {
exit_withchange exit_withchange
} }
## Configure Task
function task_configure {
TASKTYPE='CONFIGURE'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good
#MESSAGE="${TASKTYPE} Requested"
#echo_info
if [ -f $HOME/${LOCAL_FOLDR}/${CONFIG_FILE} ]
then
config_delete
else
MESSAGE="No Active ${CONFIG_FILE}"
echo_warn
config_generate
fi
}
function task_devmode {
TASKTYPE='DEV'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good
if [ -f $HOME/${LOCAL_FOLDR}/dev ]
then
MESSAGE="Disabling ${TASKTYPE}"
echo_stat
rm -f $HOME/${LOCAL_FOLDR}/dev
error_validate
else
MESSAGE="Enabling ${TASKTYPE}"
echo_stat
touch $HOME/${LOCAL_FOLDR}/dev
error_validate
fi
MESSAGE="Run UPDATE to apply changes"
echo_info
exit_withchange
}
# Echo Stack # Echo Stack
## Informative ## Informative
function echo_info { function echo_info {
@ -1170,7 +1215,7 @@ function echo_need {
# SCRIPT EXECUTION ########################### # SCRIPT EXECUTION ###########################
SCRIPT_START=$SECONDS SCRIPT_START=$SECONDS
MESSAGE="${PROGRAM} Executing" MESSAGE="${PROGRAM} ${VERSION} Executing"
echo_info echo_info
MESSAGE="Evaluating Arguments" MESSAGE="Evaluating Arguments"
@ -1207,10 +1252,11 @@ case $# in
push) push)
TASKTYPE='PUSH' TASKTYPE='PUSH'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
MESSAGE="${TASKTYPE} Requested" #MESSAGE="${TASKTYPE} Requested"
echo_info #echo_info
import_gs import_gs
@ -1226,10 +1272,11 @@ case $# in
restore) restore)
TASKTYPE='RESTORE' TASKTYPE='RESTORE'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
MESSAGE="${TASKTYPE} Requested" #MESSAGE="${TASKTYPE} Requested"
echo_info #echo_info
import_gs import_gs
@ -1245,10 +1292,11 @@ case $# in
version) version)
TASKTYPE='VERSION' TASKTYPE='VERSION'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
MESSAGE="${TASKTYPE} Requested" #MESSAGE="${TASKTYPE} Requested"
echo_info #echo_info
show_version show_version
exit_nochange exit_nochange
@ -1256,53 +1304,45 @@ case $# in
update) update)
TASKTYPE='UPDATE' TASKTYPE='UPDATE'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
MESSAGE="${TASKTYPE} Requested" #MESSAGE="${TASKTYPE} Requested"
echo_info #echo_info
update_gs update_gs
;; ;;
dev) dev)
TASKTYPE='DEV' task_devmode
echo_good ;;
if [ -f $HOME/${LOCAL_FOLDR}/dev ] devmode)
then task_devmode
MESSAGE="Disabling ${TASKTYPE}" ;;
echo_stat
rm -f $HOME/${LOCAL_FOLDR}/dev development)
error_validate task_devmode
else
MESSAGE="Enabling ${TASKTYPE}"
echo_stat
touch $HOME/${LOCAL_FOLDR}/dev
error_validate
fi
MESSAGE="Run UPDATE to apply changes"
echo_info
exit_withchange
;; ;;
logs) logs)
TASKTYPE='LOGS' TASKTYPE='LOGS'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
MESSAGE="${TASKTYPE} Requested" #MESSAGE="${TASKTYPE} Requested"
echo_info #echo_info
logs_gs logs_gs
;; ;;
compare) compare)
TASKTYPE='COMPARE' TASKTYPE='COMPARE'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
MESSAGE="${TASKTYPE} Requested" #MESSAGE="${TASKTYPE} Requested"
echo_info #echo_info
import_gs import_gs
@ -1318,30 +1358,21 @@ case $# in
cron) cron)
TASKTYPE='CRON' TASKTYPE='CRON'
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
echo_good echo_good
MESSAGE="${TASKTYPE} Requested" #MESSAGE="${TASKTYPE} Requested"
echo_info #echo_info
show_crontab show_crontab
;; ;;
config) config)
TASKTYPE='CONFIGURE' task_configure
echo_good ;;
MESSAGE="${TASKTYPE} Requested" configure)
echo_info task_configure
if [ -f $HOME/${LOCAL_FOLDR}/${CONFIG_FILE} ]
then
config_delete
else
MESSAGE="No Active ${CONFIG_FILE}"
echo_warn
config_generate
fi
;; ;;
auto) auto)