aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/misc/tinc/Manifest31
-rw-r--r--net/misc/tinc/rc.tinc.new58
-rw-r--r--net/misc/tinc/tinc.SlackBuild49
3 files changed, 122 insertions, 16 deletions
diff --git a/net/misc/tinc/Manifest b/net/misc/tinc/Manifest
index c0ee279a..32bfb935 100644
--- a/net/misc/tinc/Manifest
+++ b/net/misc/tinc/Manifest
@@ -2,22 +2,23 @@
Hash: SHA256
DIST tinc-1.0.9.tar.gz 519048 MD5 f907acebada53512e01235bea6b4cdf1 RMD160 43ad67040ed7aaad710c5137659f8f0f1d908101 SHA1 55de1bc3b47a48fb162b00ffbb3bac1e2058a7ed SHA256 3159fb656b902e3320123f02f7c8c7e82a0503f7e490424bb94f86d328844593 SHA512 171a38765f92428837716ad48cf4e2b2cf4e9e4b06215504f7d14675fa665e6d702a3616ceaf679e274385324680ac210303c62dd3006a36cc0fa6955f7ca85b
-MKBUILD tinc.mkbuild 4957 MD5 af76e1a9d336916a403dc3d151bb4683 RMD160 c7c66147fd2dcf62666e7632acd09ee511caafae SHA1 f6c414584f7b024236b12bbc3863522612a4e238 SHA256 ec498a01f84526574665cb86396f255b9435713b0a2ebc4829fbba1d50059a16 SHA512 ebd7770c1f302ac3a7ac6657efe32d09796dc5363c94a87ddbc95a92d4e90f9d194bd02f5c3a4e273571c2b7d82616b23fa83ebd55e70567e0d422163b478403
-SLACKBUILD tinc.SlackBuild 8616 MD5 b4382d4cb6f5fc07a12e2f669f11d989 RMD160 2e2e826083743c892b00804af008188339f70532 SHA1 7cb6d9f2cc838c2574565d4a7ca43e91ff974879 SHA256 60133c7351df830dc63d2f30ce3349f2c0d67bf1b1d352aad03221256a00d27b SHA512 b44abf07e47c708b1181ffb2e988364bc467506933c54e6f14831d5687a1b982df789c6043dbc7b19fc729c262298314ffb790dedb2ed201f9f83039bc8cb2d3
+MISC rc.tinc.new 1115 MD5 01fae9473cd5a047d73c9a0fc91aa9dc RMD160 34648080440222db8ac3ff10b9094b1d2fd91380 SHA1 5d58a88f7701b90435261bb16af4313a291055ea SHA256 1e1d6dc0816b37209e9c849b0550d4626073f0fa87ad435af1c5a7574eabda86 SHA512 e24c70ef1564a237615aa38ca0e25f876d2814d800e86304e0e68f5a1b44a4731dedaadeae4cd7f3e3cb130c492d74233d6c4347c942bbbfd35df6c614df90d6
+MKBUILD tinc.mkbuild 4983 MD5 35457370bfefb2525bc4fb74fffd7f4f RMD160 9f45cf994f08846a5435a50efd02f0d130f0eb3f SHA1 7b5342be61ad14ea268f241c8c6db0fa39562f70 SHA256 70e51a79106c52c53a69db560fe0d0f20d982832aadf136cdf3302c59bab121b SHA512 e453ac6235e9c9ced6a1bd924b07be16bc945f929cbf3a0afa94ad178e45359d3d74611021c792ba9a92b18bb3bab8ca4e1e4ebab26b9f73581c8c474da969b9
+SLACKBUILD tinc.SlackBuild 9709 MD5 56c561bf46c42eaedc402404732195a1 RMD160 d8ab8764cfd3ab0fc47e631390e04f840e0cc076 SHA1 40060deea7799aaaf474c686e9ec50fa75edcd3c SHA256 69e11b757777c971e91145cff439b96855caa3fc5e854f99cfbe394b69e6c532 SHA512 bd717177e707d8d43c71b7da7cd51ce8c647eb7d5f163cc81a320dfd3ea585806549cb4f8e96cb3004d6e64f38919ff255217a560fbc558cad0d9a03a4a581ca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-iQIcBAEBCAAGBQJKQwXZAAoJEEHL93ESzgeiyNkP/RYQRU/puhvaK/bs0mvOLIFr
-CRl3hkMFlr3E0rOswU3o360YWipu6TcIWdWJkqlQqfC24kizdlL6eqU6UOcqRCvg
-oyOzxXz2Ivzp9tz84Fy40avf6E5dff8P2/41Uc6mK3vK/BYixg6BzLuyZmO/vBdI
-LpfPY/Slz1EeRUMz+WDUwtn0El5BkDSX+LV5QrvfzGqb53z5nEmUJZvTgZr61+96
-gkiQi4MbcgU7/5C31iR2YdhBywINwBc8AOV0a7i3Niki2VB9EsG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/5fikGciumZ13Q
+deFWnuVIAreT/UciKHzVdwZI2NLu2mtTGsuIj7c570dJHH8GFmq7jMpLj1FmF8EN
+4IBuLS/Utw1TIGvQgu3m
+=/YSy
-----END PGP SIGNATURE-----
diff --git a/net/misc/tinc/rc.tinc.new b/net/misc/tinc/rc.tinc.new
new file mode 100644
index 00000000..2b8a24b8
--- /dev/null
+++ b/net/misc/tinc/rc.tinc.new
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+tinc_networks() {
+
+ for conf in `ls /etc/tinc`; do
+ if [ -e "/etc/tinc/$conf/tinc.conf" ]; then
+ echo $conf
+ fi
+ done
+
+}
+
+tinc_start() {
+ echo "Starting tinc VPN networks"
+ for TINCNET in `tinc_networks`; do
+ echo "Starting tinc network $TINCNET"
+ /usr/sbin/tincd --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid
+ done
+}
+
+tinc_stop() {
+ echo "Stopping tinc VPN networks"
+ for TINCNET in `tinc_networks`; do
+ if [ -f /var/run/tinc."$TINCNET".pid ]; then
+ echo "Stopping tinc network $TINCNET"
+ /usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid
+ fi
+ done
+}
+
+tinc_reload() {
+ echo "Reloading configuration for tinc VPN networks"
+ for TINCNET in `tinc_networks`; do
+ if [ -f /var/run/tinc."$TINCNET".pid ]; then
+ echo "Reloading tinc network $TINCNET"
+ /usr/sbin/tincd --kill HUP --pidfile=/var/run/tinc."$TINCNET".pid
+ fi
+ done
+}
+
+case "$1" in
+'start')
+ tinc_start
+ ;;
+'stop')
+ tinc_stop
+ ;;
+'restart')
+ tinc_stop
+ tinc_start
+ ;;
+'reload')
+ tinc_reload
+ ;;
+*)
+ echo "usage $0 start|stop|restart|reload"
+esac
+
diff --git a/net/misc/tinc/tinc.SlackBuild b/net/misc/tinc/tinc.SlackBuild
index ee80b11e..a3a7370f 100644
--- a/net/misc/tinc/tinc.SlackBuild
+++ b/net/misc/tinc/tinc.SlackBuild
@@ -34,7 +34,7 @@ PKG_NAME="tinc"
ARCH=${ARCH:=i486}
SRC_VERSION=${VERSION:=1.0.9}
PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
-BUILD=${BUILD:=2rha}
+BUILD=${BUILD:=3rha}
SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
TMP=${TMP:=/tmp}
PKG=${PKG:=$TMP/package-$PKG_NAME}
@@ -238,6 +238,10 @@ if [ -d "$PKG/$PREFIX/man" ]; then
)
fi
+# Copy init scripts
+mkdir -p $PKG/etc/rc.d
+cp $CWD/rc.* $PKG/etc/rc.d/
+
# Install documentation
DOCS="ABOUT-NLS AUTHORS COPYING COPYING.README ChangeLog NEWS README THANKS"
mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
@@ -271,6 +275,49 @@ tinc:
tinc:
EODESC
+# Add a post-installation script (doinst.sh)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EOSCRIPT > "$PKG/install/doinst.sh"
+config() {
+ NEW="\$1"
+ OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
+ OLD="\$(dirname \$NEW)/\$(basename \$OLD .sample)"
+ OLD="\$(dirname \$NEW)/\$(basename \$OLD .dist)"
+
+ # If there's no config file by that name, mv it over:
+ if [ ! -r \$OLD ]; then
+ mv \$NEW \$OLD
+ elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm \$NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+mkgroup() {
+ GROUP="\$1"
+ if ! grep -qe "^\$GROUP:" etc/group; then
+ echo Creating group \$GROUP...
+ chroot . /usr/sbin/groupadd \$GROUP
+ fi
+}
+
+mkuser() {
+ USER="\$1"
+ if [ ! -z "\$2" ]; then
+ GROUP="\$2"
+ else
+ GROUP="\$USER"
+ fi
+ if ! grep -qe "^\$USER:" etc/passwd; then
+ echo Creating user \$USER...
+ chroot . /usr/sbin/useradd \$USER -g \$GROUP
+ fi
+}
+
+config etc/rc.d/rc.tinc.new
+EOSCRIPT
+
# Build the package
cd "$PKG"
mkdir -p $REPOS/$SLACKBUILD_PATH