diff options
author | ramon <ramongomez@us.es> | 2017-12-11 12:35:16 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2017-12-11 12:35:16 +0000 |
commit | f60723c03f7537793d61cb19caf509954ed54687 (patch) | |
tree | 9419d7e22aabb6fe90635dc930d403c867acaf42 /server/bin/oglivecli | |
parent | 24114987223cf031f2f3e60faa885ff5806a4d7a (diff) |
#768: {{{oglivecli check}}} comprueba también si hay nuevas descargas de imágenes ISO después de haber sido instaladas.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5525 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'server/bin/oglivecli')
-rwxr-xr-x | server/bin/oglivecli | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/bin/oglivecli b/server/bin/oglivecli index cc2de743..5be4e6dc 100755 --- a/server/bin/oglivecli +++ b/server/bin/oglivecli @@ -186,7 +186,7 @@ function check() { [ ! -f $INFOFILE ] && echo "Configuration file does not exists: $INFOFILE" && let ERR++ [ -f $INFOFILE -a "$(jq -c keys $INFOFILE 2>/dev/null)" != "[\"default\",\"oglive\"]" ] && echo "Format error in configuration file: $INFOFILE" && let ERR++ [ ! -e $TFTPDIR ] && echo "TFTP directory does not exist: $TFTPDIR." && let ERR++ - # Check for installed ogLives. + # Check for installed ogLive clients. INST=( $(find $TFTPDIR/ -type d -name "$DEFOGLIVE-*" -a ! -name "*.old" -printf "%f\n" | sort) ) [[ ${#INST[@]} -eq 0 ]] && echo "No ogLive clients are installed." && let ERR++ DEF=( $(jq -r .oglive[].directory $INFOFILE 2>/dev/null | sort) ) @@ -202,6 +202,12 @@ function check() { [ -n "$AUX" ] && echo "Some ISOs are downloaded but not defined: ${AUX//$'\n'/, }" && let ERR++ AUX=$(comm -13 <(printf "%s\n" ${INST[*]}) <(printf "%s\n" ${DEF[*]})) [ -n "$AUX" ] && echo "Some ISOs are defined but not downloaded: ${AUX//$'\n'/, }" && let ERR++ + # Check for new ISO files downloaded after installation. + AUX=$(jq -r '.oglive[] as $og | $og.iso + ":" + $og.directory' $INFOFILE 2>/dev/null | \ + while IFS=":" read -r DEF INST; do + [ $DOWNLOADDIR/$DEF -nt $TFTPDIR/$INST ] && echo "$DEF" + done) + [ -n "$AUX" ] && echo "Some ISOs are downloaded after installation: ${AUX//$'\n'/, }" && let ERR++ # Print result. [ $ERR -eq 0 ] && echo "OK!" || echo "Problems detected: $ERR" return $ERR |