wok rev 1435
Add knock
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 01 11:27:07 2008 +0000 (2008-10-01) |
parents | b38a3f04facb |
children | e58706fa0b9d |
files | knock/receipt knock/stuff/etc/init.d/knock knock/stuff/knock.u |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/knock/receipt Wed Oct 01 11:27:07 2008 +0000 1.3 @@ -0,0 +1,33 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="knock" 1.7 +VERSION="0.5" 1.8 +CATEGORY="security" 1.9 +SHORT_DESC="Port knock sequence listener." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.12 +WEB_SITE="http://www.zeroflux.org/$PACKAGE" 1.13 +WGET_URL="http://www.zeroflux.org/proj/$PACKAGE/files/$TARBALL" 1.14 +CONFIG_FILES="/etc/knock" 1.15 + 1.16 +# Rules to configure and make the package. 1.17 +compile_rules() 1.18 +{ 1.19 + cd $src 1.20 + patch -p1 < ../stuff/knock.u 1.21 + ./configure --prefix=/usr --infodir=/usr/share/info \ 1.22 + --mandir=/usr/share/man $CONFIGURE_ARGS && 1.23 + make && 1.24 + make DESTDIR=$PWD/_pkg install 1.25 +} 1.26 + 1.27 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.28 +genpkg_rules() 1.29 +{ 1.30 + mkdir -p $fs/usr 1.31 + cp -a $_pkg/etc $fs 1.32 + cp -a $_pkg/usr/sbin $fs/usr 1.33 + cp -a $_pkg/usr/bin $fs/usr 1.34 + cp -a stuff/etc $fs 1.35 +} 1.36 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/knock/stuff/etc/init.d/knock Wed Oct 01 11:27:07 2008 +0000 2.3 @@ -0,0 +1,56 @@ 2.4 +#!/bin/sh 2.5 +# /etc/init.d/knock : Start, stop and restart knockd server on SliTaz, at 2.6 +# boot time or with the command line. 2.7 +# 2.8 +# To start Knock server at boot time, just put knock in the $RUN_DAEMONS 2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf 2.10 +# 2.11 +. /etc/init.d/rc.functions 2.12 +. /etc/daemons.conf 2.13 + 2.14 +NAME=Knock 2.15 +DESC="Knock server" 2.16 +DAEMON=/usr/sbin/knockd 2.17 +OPTIONS=$KNOCK_OPTIONS 2.18 +PIDFILE=/var/run/knockd.pid 2.19 +[ -n "$OPTIONS" ] || OPTIONS="-d" 2.20 + 2.21 +case "$1" in 2.22 + start) 2.23 + if [ -f $PIDFILE ] ; then 2.24 + echo "$NAME already running." 2.25 + exit 1 2.26 + fi 2.27 + echo -n "Starting $DESC: $NAME... " 2.28 + $DAEMON $OPTIONS 2.29 + status 2.30 + ;; 2.31 + stop) 2.32 + if [ ! -f $PIDFILE ] ; then 2.33 + echo "$NAME is not running." 2.34 + exit 1 2.35 + fi 2.36 + echo -n "Stopping $DESC: $NAME... " 2.37 + kill `cat $PIDFILE` 2.38 + status 2.39 + ;; 2.40 + restart) 2.41 + if [ ! -f $PIDFILE ] ; then 2.42 + echo "$NAME is not running." 2.43 + exit 1 2.44 + fi 2.45 + echo -n "Restarting $DESC: $NAME... " 2.46 + kill `cat $PIDFILE` 2.47 + sleep 2 2.48 + $DAEMON $OPTIONS 2.49 + status 2.50 + ;; 2.51 + *) 2.52 + echo "" 2.53 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 2.54 + echo "" 2.55 + exit 1 2.56 + ;; 2.57 +esac 2.58 + 2.59 +exit 0
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/knock/stuff/knock.u Wed Oct 01 11:27:07 2008 +0000 3.3 @@ -0,0 +1,32 @@ 3.4 +--- knock-0.5/Makefile.in 3.5 ++++ knock-0.5/Makefile.in 3.6 +@@ -68,11 +68,15 @@ 3.7 + (cd ..; tar czvf knock-$(VERSION).tar.gz knock-$(VERSION)) 3.8 + 3.9 + install: all 3.10 +- $(INSTALL) -D -m0755 knockd $(DESTDIR)$(SBINDIR)/knockd 3.11 +- $(INSTALL) -D -m0755 knock $(DESTDIR)$(BINDIR)/knock 3.12 +- $(INSTALL) -D -m0644 $(MANSRC)knockd.1 $(DESTDIR)$(MANDIR)/man1/knockd.1 3.13 +- $(INSTALL) -D -m0644 $(MANSRC)knock.1 $(DESTDIR)$(MANDIR)/man1/knock.1 3.14 +- $(INSTALL) -D -m0644 knockd.conf $(DESTDIR)/etc/knockd.conf 3.15 ++ mkdir -p $(DESTDIR)$(SBINDIR) 3.16 ++ $(INSTALL) -m0755 knockd $(DESTDIR)$(SBINDIR)/knockd 3.17 ++ mkdir -p $(DESTDIR)$(BINDIR) 3.18 ++ $(INSTALL) -m0755 knock $(DESTDIR)$(BINDIR)/knock 3.19 ++ mkdir -p $(DESTDIR)$(MANDIR)/man1 3.20 ++ $(INSTALL) -m0644 $(MANSRC)knockd.1 $(DESTDIR)$(MANDIR)/man1/knockd.1 3.21 ++ $(INSTALL) -m0644 $(MANSRC)knock.1 $(DESTDIR)$(MANDIR)/man1/knock.1 3.22 ++ mkdir -p $(DESTDIR)/etc 3.23 ++ $(INSTALL) -m0644 knockd.conf $(DESTDIR)/etc/knockd.conf 3.24 + 3.25 + clean: 3.26 + rm -f *~ $(OBJDIR)*.o $(MANSRC)*.1 3.27 + 3.28 +--- knock-0.5/knockd.conf 3.29 ++++ knock-0.5/knockd.conf 3.30 +@@ -1,4 +1,5 @@ 3.31 + [options] 3.32 ++ PidFile = /var/run/knockd.pid 3.33 + logfile = /var/log/knockd.log 3.34 + 3.35 + [openSSH]