Indexed arrays were only needed to override defaults.

This commit is contained in:
2015-08-31 01:56:54 +03:00
parent ec2ff428f8
commit 2b32655365
2 changed files with 22 additions and 23 deletions

20
rc.in
View File

@@ -26,16 +26,16 @@ rc.tmpfiles() {
done
}
rc.mount_misc() {
for fs in "${!cfg_mounts[@]}"; do
echo "${cfg_mounts[$fs]}" | while IFS=':' read fs_type mountpoint mount_options; do
[[ "$mount_options" ]] || { mount_options='defaults'; }
rc.mount() {
for fs in "${cfg_mounts[@]}"; do
echo "$fs" | while IFS=':' read device fs_type mountpoint mount_options
mountpoint -q "$mountpoint" || {
[[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; }
mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint"
}
done
[[ "$mount_options" ]] || { mount_options='defaults'; }
mountpoint -q "$mountpoint" || {
[[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; }
mount "$device" -n -t "$fs_type" -o "$mount_options" "$mountpoint"
}
done
}
@@ -108,7 +108,7 @@ rc.remount_root() {
}
rc.boot() {
rc.mount_misc
rc.mount
rc.tmpfiles
rc.hostname
rc.timezone