[Main]
Type = oneshot
Description = "Uncomplicated FireWall"
User = ( root )
Version = 0.0.2.1

[Start]
Execute = ( 
		backtick -n UFW_CONF { mktemp -p /dev/shm }
		importas -uS UFW_CONF
		foreground { 
					if -n { test -e ${Config_File} } 
					redirfd -w 1 ${Config_File} cat ${Alt_Config_File} 
					}
		foreground { redirfd -w 1 ${UFW_CONF} cat ${Config_File} }
		foreground { ufw enable }
		foreground { redirfd -w 1 ${Config_File} cat ${UFW_CONF} }
		rm -f -- ${UFW_CONF}
    )

[Stop]
Execute = ( 
		backtick -n UFW_CONF { mktemp -p /dev/shm }
		importas -uS UFW_CONF
		foreground { redirfd -w 1 ${UFW_CONF} cat ${Config_File} }
		foreground { ufw disable }
		foreground { redirfd -w 1 ${Config_File} cat ${UFW_CONF} }
		rm -f -- ${UFW_CONF}
		)

[Environment]
Config_File=!/etc/ufw/ufw.conf
Alt_Config_File=!/usr/share/ufw/ufw.conf
