diff --git a/ufw-init b/ufw-init new file mode 100644 index 0000000..4387204 --- /dev/null +++ b/ufw-init @@ -0,0 +1,61 @@ +#! /bin/bash +# Copyright (c) 2000-2002 SuSE GmbH Nuernberg, Germany. +# Copyright (C) 2003,2004 SUSE Linux AG +# Copyright (C) 2005-2008 SUSE LINUX Products GmbH +# +# Author: LUCE Johann +# Maintainer: LUCE Johann +# +# /etc/init.d/ufw +# +### BEGIN INIT INFO +# Provides: ufw +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: ufw_enable +# Description: Uncomplicated Firewall +### END INIT INFO + +UFWALL="/usr/sbin/ufw" + +test -x $UFWALL || exit 5 + +. /etc/rc.status +. /etc/ufw/ufw.conf + +rc_reset + +case "$1" in + start) + echo -n "checking if ufw enable" + if [ $ENABLED == 'yes' ] ;then + $UFWALL enable + else + echo -n "ufw is disable" + fi + rc_status -v + ;; + stop) + rc_status + ;; + restart|force-reload) + $O stop + $0 start + ;; + try-restart|reload) + if ($0 status) >/dev/null 2>&1; then + $0 start + else + rc_reset + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart|reload|}" + exit 1 + ;; +esac + +# Set exit status +rc_exit diff --git a/ufw.changes b/ufw.changes index 1fc45ba..1509eae 100644 --- a/ufw.changes +++ b/ufw.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Oct 11 15:05:51 UTC 2011 - johann.luce@wanadoo.fr + +bug on restart in init file- + +------------------------------------------------------------------- +Mon Oct 10 16:13:12 UTC 2011 - johann.luce@wanadoo.fr + +add opensuse init script - + ------------------------------------------------------------------- Thu Oct 6 21:17:36 UTC 2011 - johann.luce@wanadoo.fr diff --git a/ufw.spec b/ufw.spec index 2ffa7c2..337f7ba 100644 --- a/ufw.spec +++ b/ufw.spec @@ -6,12 +6,13 @@ Group: Productivity/Networking/Security License: GPLv3+ URL: http://launchpad.net/%{name} Source0: %{name}-%{version}.tar.bz2 +Source1: ufw-init #BuildArch: noarch BuildRequires: python-devel BuildRequires: iptables-devel -#Requires: python +#Requires: %description The Uncomplicated Firewall(ufw) is a front-end for netfilter, which aims to make it easier for people unfamiliar with firewall concepts. @@ -32,7 +33,19 @@ manipulating the firewall. rm -rf %{buildroot} python setup.py install --prefix=/usr \ --root %{buildroot} +mkdir -p $RPM_BUILD_ROOT/etc/init.d/ +install -m 755 $RPM_SOURCE_DIR/ufw-init $RPM_BUILD_ROOT/etc/init.d/ufw +ln -s /etc/init.d/ufw $RPM_BUILD_ROOT/usr/sbin/rcufw +mkdir -p $RPM_BUILD_ROOT/usr/bin/ +ln -s /usr/sbin/ufw $RPM_BUILD_ROOT/usr/bin/ufw +%post +insserv /etc/init.d/ufw +%preun +%stop_on_removal ufw + +%postun +%insserv_cleanup /etc/init.d/ufw %files %defattr(-,root,root) @@ -42,8 +55,11 @@ python setup.py install --prefix=/usr \ /lib/ufw/user6.rules /usr/lib/python%python_version/site-packages/ufw-0.30.1-py%python_version.egg-info /usr/sbin/ufw + /usr/sbin/rcufw + /usr/bin/ufw /usr/share/man/man8/ufw-framework.8.gz /usr/share/man/man8/ufw.8.gz + %config/etc/init.d/ufw %config/etc/ufw %config/etc/ufw/applications.d %config/etc/default/ufw