diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-04 08:38:12 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-04 08:38:12 +0100 |
commit | 773810d97635057e51101f90114fdbf957cc2d9d (patch) | |
tree | 1e89602586e8bd2815bdd0c9abb4004a373d9256 | |
parent | ec13120eef19ea677c20c0ee0125d512e9033ed8 (diff) | |
download | itzks-systems-773810d97635057e51101f90114fdbf957cc2d9d.tar.gz itzks-systems-773810d97635057e51101f90114fdbf957cc2d9d.tar.bz2 itzks-systems-773810d97635057e51101f90114fdbf957cc2d9d.zip |
sbin/itzks-update-disklserver-squashfs-images: Rewrite script (proper variable syntax); adjust for next-generation LTSP.
-rwxr-xr-x | sbin/itzks-update-disklserver-squashfs-images | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sbin/itzks-update-disklserver-squashfs-images b/sbin/itzks-update-disklserver-squashfs-images index bc77854..55b4757 100755 --- a/sbin/itzks-update-disklserver-squashfs-images +++ b/sbin/itzks-update-disklserver-squashfs-images @@ -19,28 +19,28 @@ LTSP_OPT="/srv/ltsp" -ltsp_chroots=$(ls $LTSP_OPT | while read chroot_dir; do test ! -h $LTSP_OPT/$chroot_dir -a -x $LTSP_OPT/$chroot_dir/bin/bash && echo -n "$chroot_dir "; done) +ltsp_chroots=$(ls "${LTSP_OPT}" | while read chroot_dir; do test ! -h "${LTSP_OPT}/${chroot_dir}" -a -x "${LTSP_OPT}/${chroot_dir}/bin/bash" && echo -n "${chroot_dir} "; done) for chroot in ${ltsp_chroots}; do - if [ -e $LTSP_OPT/$chroot/chroot-upgrade-in-process ]; then - echo "Chroot $LTSP_OPT/$chroot is currently being upgraded. Skipping..." + if [ -e "${LTSP_OPT}/${chroot}/chroot-upgrade-in-process" ]; then + echo "Chroot ${LTSP_OPT}/${chroot} is currently being upgraded. Skipping..." continue fi - latest_upgrade=$(ls $LTSP_OPT/$chroot | grep -E 'chroot-updated_[0-9]{8}$' | sort | tail -n1) + latest_upgrade=$(ls ${LTSP_OPT}/${chroot} | grep -E 'chroot-updated_[0-9]{8}$' | sort | tail -n1) if [ -z "${latest_upgrade}" ]; then - echo "chroot $LTSP_OPT/$chroot lacks the chroot-updated_<date> file. Can't proceeed. Skipping..." + echo "chroot ${LTSP_OPT}/${chroot} lacks the chroot-updated_<date> file. Can't proceeed. Skipping..." continue fi - if [ -e "$LTSP_OPT/$chroot/${latest_upgrade}.squashfs-created" ]; then - echo "chroot $LTSP_OPT/$chroot's squashfs image is up-to-date. Skipping..." + if [ -e "${LTSP_OPT}/${chroot}/${latest_upgrade}.squashfs-created" ]; then + echo "chroot ${LTSP_OPT}/${chroot}'s squashfs image is up-to-date. Skipping..." else - if ltsp-update-image $chroot; then - rm -f $LTSP_OPT/$chroot/chroot-updated_*.squashfs-created - touch $LTSP_OPT/$chroot/${latest_upgrade}.squashfs-created + if ltsp image "${LTSP_OPT}/${chroot}"; then + rm -f "${LTSP_OPT}/${chroot}/chroot-updated_*.squashfs-created" + touch "${LTSP_OPT}/${chroot}/${latest_upgrade}.squashfs-created" fi fi |