X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/faf7173b4df3a152dbdc574751078b359c116d5b..77ec3b2de9bb1880b258ec6aaf4949f146f6fd8d:/package/block-mount/files/block.sh diff --git a/package/block-mount/files/block.sh b/package/block-mount/files/block.sh index b8a473a00..80f74b210 100644 --- a/package/block-mount/files/block.sh +++ b/package/block-mount/files/block.sh @@ -118,15 +118,16 @@ config_create_swap_fstab_entry() { [ -n "$device" ] || return 0 - local fstabnew="$(mktemp -t '.fstab.XXXXXXXX')" - + local fstabnew + mkdir -p /var/lock lock /var/lock/fstab.lck + fstabnew="$(mktemp -t '.fstab.XXXXXXXX')" cat /tmp/fstab | grep -E -v "^$device[[:blank:]]" >>"$fstabnew" [ "$enabled" -eq 1 ] && echo "$device none swap sw 0 0" >> "$fstabnew" cat "$fstabnew" >/tmp/fstab - lock -u /var/lock/fstab.lck rm -f $fstabnew + lock -u /var/lock/fstab.lck } config_create_mount_fstab_entry() { @@ -140,15 +141,16 @@ config_create_mount_fstab_entry() { [ -n "$target" ] || return 0 [ -n "$device" ] || return 0 - local fstabnew="$(mktemp -t '.fstab.XXXXXXXX')" - + local fstabnew + mkdir -p /var/lock lock /var/lock/fstab.lck + fstabnew="$(mktemp -t '.fstab.XXXXXXXX')" cat /tmp/fstab | grep -E -v "^$device[[:blank:]]" | grep -v "$target" >>"$fstabnew" echo "$device $target $fstype $options 0 0" >>"$fstabnew" cat "$fstabnew" >/tmp/fstab - lock -u /var/lock/fstab.lck rm -f $fstabnew + lock -u /var/lock/fstab.lck } libmount_find_token() {