diff --git a/rc.in b/rc.in index 0050fe6..12002e9 100644 --- a/rc.in +++ b/rc.in @@ -29,13 +29,21 @@ rc.tmpfiles() { rc.mount() { for fs in "${cfg_mounts[@]}"; do echo "$fs" | while IFS=':' read device fs_type mountpoint mount_options; do + if mountpoint -q "$mountpoint"; then + if [[ "$mount_options" ]]; then + mount -o "remount,$mount_options" "$mountpoint" + fi + else + if ! [[ -d "$mountpoint" ]]; then + mkdir -p "$mountpoint" + fi - [[ "$mount_options" ]] || { mount_options='defaults'; } + if ! [[ "$mount_options" ]]; then + mount_options='defaults' + fi - mountpoint -q "$mountpoint" || { - [[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; } mount "$device" -n -t "$fs_type" -o "$mount_options" "$mountpoint" - } + fi done done }