commit e4b762ec9bbed178a875e809bf7fb75af3f686f4 parent 11b6e2656a2113a941a9a1a914d9bb386f63fb15 Author: Jan Pobrislo <ccx@webprojekty.cz> Date: Thu, 7 Dec 2017 20:21:54 +0100 arbitrary fstab file Diffstat:
| M | zsh-functions/confz_fs_init | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/zsh-functions/confz_fs_init b/zsh-functions/confz_fs_init @@ -581,6 +581,7 @@ confz_fstab_check() { checkvars device mountpoint filesystem defvar opts noatime defvar dump 0 + defvar fstab /etc/fstab if [[ $vars[filesystem] == xfs ]]; then defvar pass 0 else @@ -588,7 +589,7 @@ confz_fstab_check() { fi local device mountpoint filesystem opts dump pass - sed '/^[ \t]*#/d;s/#.*//;s/[ \t]\+/ /g' /etc/fstab | \ + sed '/^[ \t]*#/d;s/#.*//;s/[ \t]\+/ /g' $vars[fstab] | \ while read device mountpoint filesystem opts dump pass; do if [[ $mountpoint == ${vars[mountpoint]} ]]; then [[ $device == ${vars[device]} && opts != *bind* ]] || \ @@ -615,12 +616,12 @@ confz_fstab_check() { fi done - fail_reason="no entry for ${(qqq)vars[mountpoint]} in /etc/fstab" + fail_reason="no entry for ${(qqq)vars[mountpoint]} in ${(qqq)vars[fstab]}" return 1 # did not find matching entry } confz_fstab_do() { - print -r - >>/etc/fstab ${vars[device]}$'\t'${vars[mountpoint]}$'\t'${vars[filesystem]}$'\t'${vars[opts]}$'\t'${vars[dump]}' '${vars[pass]} + print -r - >>$vars[fstab] ${vars[device]}$'\t'${vars[mountpoint]}$'\t'${vars[filesystem]}$'\t'${vars[opts]}$'\t'${vars[dump]}' '${vars[pass]} }