summaryrefslogtreecommitdiffstats
path: root/extra/knock
diff options
context:
space:
mode:
Diffstat (limited to 'extra/knock')
-rw-r--r--extra/knock/.footprint22
-rw-r--r--extra/knock/.md5sum1
-rw-r--r--extra/knock/Pkgfile16
-rw-r--r--extra/knock/knockd37
4 files changed, 70 insertions, 6 deletions
diff --git a/extra/knock/.footprint b/extra/knock/.footprint
index 2a5eb76a7..4ff7a8db9 100644
--- a/extra/knock/.footprint
+++ b/extra/knock/.footprint
@@ -2,12 +2,26 @@ drwxr-xr-x root/root etc/
-rw-r--r-- root/root etc/knockd.conf
drwxr-xr-x root/root etc/rc.d/
drwxr-xr-x root/root etc/rc.d/init.d/
+-rwxr-xr-x root/root etc/rc.d/init.d/knockd
+drwxr-xr-x root/root etc/rc.d/rc0.d/
+lrwxrwxrwx root/root etc/rc.d/rc0.d/K90knockd -> ../init.d/knockd
+drwxr-xr-x root/root etc/rc.d/rc1.d/
+lrwxrwxrwx root/root etc/rc.d/rc1.d/K90knockd -> ../init.d/knockd
+drwxr-xr-x root/root etc/rc.d/rc3.d/
+lrwxrwxrwx root/root etc/rc.d/rc3.d/S20knockd -> ../init.d/knockd
+drwxr-xr-x root/root etc/rc.d/rc4.d/
+lrwxrwxrwx root/root etc/rc.d/rc4.d/S20knockd -> ../init.d/knockd
+drwxr-xr-x root/root etc/rc.d/rc5.d/
+lrwxrwxrwx root/root etc/rc.d/rc5.d/S20knockd -> ../init.d/knockd
+drwxr-xr-x root/root etc/rc.d/rc6.d/
+lrwxrwxrwx root/root etc/rc.d/rc6.d/K90knockd -> ../init.d/knockd
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/knock
-drwxr-xr-x root/root usr/man/
-drwxr-xr-x root/root usr/man/man1/
--rw-r--r-- root/root usr/man/man1/knock.1
--rw-r--r-- root/root usr/man/man1/knockd.1
drwxr-xr-x root/root usr/sbin/
-rwxr-xr-x root/root usr/sbin/knockd
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+-rw-r--r-- root/root usr/share/man/man1/knock.1.gz
+-rw-r--r-- root/root usr/share/man/man1/knockd.1.gz
diff --git a/extra/knock/.md5sum b/extra/knock/.md5sum
index eae76a833..d104407c3 100644
--- a/extra/knock/.md5sum
+++ b/extra/knock/.md5sum
@@ -1 +1,2 @@
ca09d61458974cff90a700aba6120891 knock-0.5.tar.gz
+32db9bf00705dd1bbb9782c2964abcd8 knockd
diff --git a/extra/knock/Pkgfile b/extra/knock/Pkgfile
index 7c9e15ca0..537c88afe 100644
--- a/extra/knock/Pkgfile
+++ b/extra/knock/Pkgfile
@@ -7,14 +7,26 @@
name=knock
version=0.5
release=1
-source=(http://www.zeroflux.org/proj/knock/files/$name-$version.tar.gz)
+source=(http://www.zeroflux.org/proj/knock/files/$name-$version.tar.gz\
+ knockd)
build() {
cd $name-$version
# build-time config
echo "#include <limits.h>" >> src/list.h
- ./configure --prefix=/usr
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man
make
make DESTDIR=$PKG install
+ # Installation du service
+ mkdir -v -p $PKG/etc/rc.d/init.d
+ mkdir -v -p $PKG/etc/rc.d/rc{0,1,3,4,5,6}.d
+ install -m755 ../knockd $PKG/etc/rc.d/init.d/
+ ln -svf ../init.d/knockd $PKG/etc/rc.d/rc3.d/S20knockd
+ ln -svf ../init.d/knockd $PKG/etc/rc.d/rc5.d/S20knockd
+ ln -svf ../init.d/knockd $PKG/etc/rc.d/rc4.d/S20knockd
+ ln -svf ../init.d/knockd $PKG/etc/rc.d/rc0.d/K90knockd
+ ln -svf ../init.d/knockd $PKG/etc/rc.d/rc1.d/K90knockd
+ ln -svf ../init.d/knockd $PKG/etc/rc.d/rc6.d/K90knockd
}
diff --git a/extra/knock/knockd b/extra/knock/knockd
new file mode 100644
index 000000000..413e77a70
--- /dev/null
+++ b/extra/knock/knockd
@@ -0,0 +1,37 @@
+#!/bin/sh
+. /etc/sysconfig/rc
+. $rc_functions
+
+pidfile=/var/run/knockd.pid
+
+case "$1" in
+ start)
+ boot_mesg "Starting KNOCKD Server..."
+ loadproc /usr/sbin/knockd -d;;
+
+ stop)
+ boot_mesg "Stopping KNOCKD Server..."
+ killproc /usr/sbin/knockd
+ ;;
+
+ reload)
+ boot_mesg "Reloading KNOCKD Server..."
+ reloadproc /usr/sbin/knockd
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ statusproc /usr/sbin/knockd
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|reload|restart|status}"
+ exit 1
+ ;;
+esac
+