noautomount

pull/65/head
TomasM 2019-01-02 17:07:35 +00:00
parent 32f35a745d
commit 77907d4abe
1 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,18 @@ UNIT="media-$BAS.mount"
MNT="/media/$BAS" MNT="/media/$BAS"
TARGET="/etc/systemd/system/$UNIT" TARGET="/etc/systemd/system/$UNIT"
# exit if noautomount boot parameter is present
if cat /proc/cmdline | grep -q noautomount; then
exit
fi
# exit if 'automount' boot parameter is missing
if ! cat /proc/cmdline | grep -q automount; then
exit
fi
if [ "$ACTION" = "add" -o "$ACTION" = "change" ]; then if [ "$ACTION" = "add" -o "$ACTION" = "change" ]; then
if [ ! -r "$TARGET" ]; then # skip if exists if [ ! -r "$TARGET" ]; then # skip if exists