diff options
author | Christos.K <freedomrfox@gmail.com> | 2017-08-26 15:09:46 +0300 |
---|---|---|
committer | Christos.K <freedomrfox@gmail.com> | 2017-08-26 15:09:46 +0300 |
commit | b6e91731668112f91e4a11028870379409331242 (patch) | |
tree | 88d86fc5e7fe88dccd4dad750fa692cb31df8053 | |
parent | Fixed script name (diff) | |
download | GSE-b6e91731668112f91e4a11028870379409331242.tar.gz GSE-b6e91731668112f91e4a11028870379409331242.tar.bz2 GSE-b6e91731668112f91e4a11028870379409331242.zip |
Changed rsync transfer to hash check instead
-rwxr-xr-x | config.d/controller/modules/functions/ct_fetch.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/config.d/controller/modules/functions/ct_fetch.sh b/config.d/controller/modules/functions/ct_fetch.sh index c8a893b..631ea9d 100755 --- a/config.d/controller/modules/functions/ct_fetch.sh +++ b/config.d/controller/modules/functions/ct_fetch.sh @@ -29,9 +29,12 @@ _mount_sysfs() { unset _fscheck + echo "Attempting to mount ${SYSDEV} at $1" if eval mount -t "${SYSFS}" -o rw -L "SYSFS" "$1"; then + echo "Mounted successfully" return 0 else + echo "Failed mounting" return 1 fi } @@ -48,7 +51,7 @@ _fetch_version() { # FETCH NEW CONFIG.D DIRECTORY _fetch_confd() { - if rsync -aAPhrq "${_ser_user}@${_ctserver}:${_conf_dir}/" "${CTCONFDIR}/confdir/"; then + if rsync -aAPhrqc "${_ser_user}@${_ctserver}:${_conf_dir}/" "${CTCONFDIR}/confdir/" --delete; then _ctflag_confd=0 else _ctflag_confd=1 @@ -76,9 +79,9 @@ _check_version() { echo "Remote version matches the local" _ctflag_sysfetch=1 fi - else + elif [[ ! -e "/mnt/workdir/var/lib/gse/version" ]]; then echo "System is corrupted" - _ctflag_sysfetch=0 + _call_backup_switch fi export _ctflag_sysfetch fi |