summaryrefslogtreecommitdiff
path: root/setup-lbu.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-05 11:29:53 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-05 11:29:53 +0200
commitb9075fd396a68e7de44443379f0513243a96dc3c (patch)
tree86028b493c9d520a59f04fa47bb3d1b8623a592c /setup-lbu.in
parent4b89713f216d0c07a84aaadfce4e503d115b3a34 (diff)
downloadalpine-conf-b9075fd396a68e7de44443379f0513243a96dc3c.zip
setup-lbu: don't suggest any iso9660 for config storage
Diffstat (limited to 'setup-lbu.in')
-rw-r--r--setup-lbu.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/setup-lbu.in b/setup-lbu.in
index 783188e..5791282 100644
--- a/setup-lbu.in
+++ b/setup-lbu.in
@@ -49,6 +49,10 @@ is_in_fstab() {
test -n "$(get_mnt_line $1 /etc/fstab)"
}
+is_iso9660() {
+ ! awk "\$2 == \"$1\" && \$3 == \"iso9660\" {exit 1}" /proc/mounts /etc/fstab
+}
+
set_media() {
local media="${1%/}" # strip trailing /
local mnt=/media/$media
@@ -111,7 +115,10 @@ alternatives=
suggestion="none"
for dir in /media/*; do
[ -d "$dir" ] || continue
- [ "$dir" = "/media/cdrom" ] && continue
+ if is_iso9660 "$dir"; then
+ continue
+ fi
+
alternatives="$alternatives, '${dir#/media/}'"
if is_mounted $dir; then
suggestion=${dir#/media/}