aboutsummaryrefslogtreecommitdiff
path: root/rc.lib
diff options
context:
space:
mode:
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() {