aboutsummaryrefslogtreecommitdiff
path: root/rc.lib
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-06-01 12:52:00 +0300
committerCem Keylan <cem@ckyln.com>2020-06-01 12:52:00 +0300
commitc3eadd27e1eb82e52ee9b801d57131d72ed41e01 (patch)
tree15b8ae7553b3bc8d2bb258c6f6a1448ba54ecb04 /rc.lib
parent110e1be55f4f3a08e269ee55f6255e5a3da8b731 (diff)
downloadinit-c3eadd27e1eb82e52ee9b801d57131d72ed41e01.tar.gz
init: make mnt function similar to KISS
Diffstat (limited to 'rc.lib')
-rw-r--r--rc.lib14
1 files changed, 10 insertions, 4 deletions
diff --git a/rc.lib b/rc.lib
index 03ef793..1df98ff 100644
--- a/rc.lib
+++ b/rc.lib
@@ -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() {