* don't reload autofs.service on loopback interface changes * add --no-block option to request asynchronous behavior OBS-URL: https://build.opensuse.org/package/show/filesystems/autofs?expand=0&rev=236
31 lines
579 B
Bash
31 lines
579 B
Bash
#! /bin/sh
|
|
#
|
|
# autofs dispatcher script for NetworkManager
|
|
#
|
|
# Matthias Koenig <mkoenig@suse.de>
|
|
#
|
|
interface="$1"
|
|
action="$2"
|
|
|
|
is_loopback() {
|
|
local type_path="/sys/class/net/$interface/type"
|
|
local interface_type=$(<"$type_path")
|
|
|
|
if [ -f "$type_path" ] && [ "$interface_type" -eq 772 ]; then
|
|
return 0
|
|
else
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
case "$action" in
|
|
up)
|
|
if ! is_loopback && test -x /usr/bin/systemctl && systemctl -q is-enabled autofs.service; then
|
|
systemctl --no-block reload autofs.service
|
|
fi
|
|
;;
|
|
*)
|
|
exit 0
|
|
;;
|
|
esac
|