rc.mount rewrite
This commit is contained in:
parent
1d5e825201
commit
0afbcc55f2
16
rc.in
16
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user