Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > a0eb70803b55ba3f102c3f988682fb28 > scriptlet

nagios-check_mk-agent-1.2.3i1-3.mga4.noarch.rpm

PREUN

/bin/sh
systemctl disable check_mk_agent.socket
systemctl restart sockets.target

POSTIN

/bin/sh
if [ $1 == 1 ]; then
	mkdir -p /etc/systemd/system/check_mk_agent.socket.d
	if ! [ -f "/etc/systemd/system/check_mk_agent.socket.d/bind.conf" ]; then
		cat > /etc/systemd/system/check_mk_agent.socket.d/bind.conf <<'EOF'
[Socket]
BindToDevice=lo
# remove this file to bind to all interfaces, but make sure you set up the firewall properly
EOF
	fi
	systemctl enable check_mk_agent.socket
	systemctl restart sockets.target
fi

POSTUN

/bin/sh
if [ $1 == 0 ]; then
	rm -f /etc/systemd/system/check_mk_agent.socket.d/bind.conf
	rmdir /etc/systemd/system/check_mk_agent.socket.d 2>/dev/null
fi