diff options
author | Cem Keylan <cem@ckyln.com> | 2020-06-01 12:52:00 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-06-01 12:52:00 +0300 |
commit | c3eadd27e1eb82e52ee9b801d57131d72ed41e01 (patch) | |
tree | 15b8ae7553b3bc8d2bb258c6f6a1448ba54ecb04 /rc.lib | |
parent | 110e1be55f4f3a08e269ee55f6255e5a3da8b731 (diff) | |
download | init-c3eadd27e1eb82e52ee9b801d57131d72ed41e01.tar.gz |
init: make mnt function similar to KISS
Diffstat (limited to 'rc.lib')
-rw-r--r-- | rc.lib | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -75,13 +75,19 @@ device_helper() { esac } -mnt() { - [ -f /proc/mounts ] && while read -r _ mnt _; do +mounted() { + [ -e "$1" ] && + [ -f /proc/mounts ] && + while read -r _ mnt _; do case "$mnt" in "$1") return 0; esac done < /proc/mounts - mnt="$1"; shift - mount "$@" "$mnt" 2>&1 | log + return 1 +} + +mnt() { + mounted "$4" && set -- "remount,$1" "$2" "$3" "$4" + mount -o "$1" -t "$2" "$3" "$4" } parse_cmdline() { |