From: Arne Fitzenreiter Date: Wed, 27 Sep 2023 15:04:08 +0000 (+0200) Subject: extrahd: add forgotten udev_event handler to mount partitions via udev X-Git-Tag: v2.27-core180~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90147c2c330eccc64391cd05e5f2427d3ae11160;p=ipfire-2.x.git extrahd: add forgotten udev_event handler to mount partitions via udev Signed-off-by: Arne Fitzenreiter Signed-off-by: Michael Tremer --- diff --git a/config/extrahd/extrahd.pl b/config/extrahd/extrahd.pl index cc85228d56..bcde077d04 100644 --- a/config/extrahd/extrahd.pl +++ b/config/extrahd/extrahd.pl @@ -116,7 +116,21 @@ extrahd_umount() { done < /var/ipfire/extrahd/devices } +handle_udev_event() { + case "${ACTION}" in + add) + if [ -n "${ID_FS_UUID}" ]; then + extrahd_mount "UUID=${ID_FS_UUID}" || return $? + fi + ;; + esac + + return 0 +} + main() { + ( echo "$@"; set ) > /tmp/extrahd.$$ + local command="${1}" shift @@ -129,6 +143,9 @@ main() { umount) extrahd_umount "${@}" || rc="${rc}" ;; + udev-event) + handle_udev_event "${@}" || rc="${rc}" + ;; scanhd) exec /usr/local/bin/scanhd "${@}" ;;