#!/bin/sh

py_pid=$(cat /usr/local/mgr5/tmp/web.pid)
if [ -n "${py_pid}" ] && ps -p "${py_pid}" >/dev/null 2>&1; then
	kill ${py_pid}
fi

if [ -f /usr/local/mgr5/tmp/acme.firewalld ]; then
        firewall-cmd --zone=public --remove-port 80/tcp
	rm -f /usr/local/mgr5/tmp/acme.firewalld
elif [ -f /usr/local/mgr5/tmp/acme.iptables ]; then
         iptables -D INPUT -p tcp --dport 80 -j ACCEPT
	 rm -f /usr/local/mgr5/tmp/acme.iptables
fi
