aboutsummaryrefslogtreecommitdiffstats
path: root/net/iodine
diff options
context:
space:
mode:
Diffstat (limited to 'net/iodine')
-rw-r--r--net/iodine/Makefile8
-rw-r--r--net/iodine/files/iodined.in56
-rw-r--r--net/iodine/pkg-deinstall27
-rw-r--r--net/iodine/pkg-install36
-rw-r--r--net/iodine/pkg-message26
5 files changed, 143 insertions, 10 deletions
diff --git a/net/iodine/Makefile b/net/iodine/Makefile
index 710e375a7ba9..8b7aea3eb6a9 100644
--- a/net/iodine/Makefile
+++ b/net/iodine/Makefile
@@ -7,6 +7,7 @@
PORTNAME= iodine
PORTVERSION= 0.4.1
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://code.kryo.se/iodine/
@@ -18,6 +19,9 @@ PLIST_FILES= bin/iodine sbin/iodined
PORTDOCS= CHANGELOG README TODO
MAN8= iodine.8
+MLINKS= iodine.8 iodined.8
+
+USE_RC_SUBR= iodined
.include <bsd.port.pre.mk>
@@ -37,4 +41,8 @@ do-install:
.endfor
.endif
+post-install:
+ @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @${CAT} ${PKGMESSAGE}
+
.include <bsd.port.post.mk>
diff --git a/net/iodine/files/iodined.in b/net/iodine/files/iodined.in
new file mode 100644
index 000000000000..3a56a4bfdf57
--- /dev/null
+++ b/net/iodine/files/iodined.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# PROVIDE: iodined
+# REQUIRE: LOGIN
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# iodined_enable (bool): Set to NO by default.
+# Set it to YES to enable iodined.
+# iodined_password (string): Not set by default, mandatory.
+# Password used for client authentication.
+# Note that the password will be visible to ps(1) et al.
+# iodined_domain (string): Not set by default, mandatory.
+# Tunnel domain delegated to iodined, e.g. "t.example.net".
+# iodined_addr (string): Set to 172.16.0.1 by default.
+# IPv4 address used for the daemon end of the tunnel.
+# iodined_flags (string): Set to "-u _iodined -t /var/empty" by default.
+# Additional flags to iodined, see manual page.
+#
+
+. %%RC_SUBR%%
+
+name="iodined"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/${name}
+
+load_rc_config $name
+
+: ${iodined_enable="NO"}
+: ${iodined_password=""}
+: ${iodined_domain=""}
+: ${iodined_addr="172.16.0.1"}
+: ${iodined_flags="-u _iodined -t /var/empty"}
+
+command_args="-P $iodined_password $iodined_addr $iodined_domain"
+
+start_precmd="iodined_precmd"
+
+iodined_precmd()
+{
+ if checkyesno iodined_enable; then
+ if [ -z "$iodined_password" ]; then
+ err 1 'Must set $iodined_password in rc.conf or rc.conf.local'
+ fi
+ if [ -z "$iodined_domain" ]; then
+ err 1 'Must set $iodined_domain in rc.conf or rc.conf.local'
+ fi
+ if [ -z "$iodined_addr" ]; then
+ err 1 'Must set $iodined_addr in rc.conf or rc.conf.local'
+ fi
+ fi
+}
+
+run_rc_command "$1"
diff --git a/net/iodine/pkg-deinstall b/net/iodine/pkg-deinstall
new file mode 100644
index 000000000000..7a5a369bcb81
--- /dev/null
+++ b/net/iodine/pkg-deinstall
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+case $2 in
+POST-DEINSTALL)
+ USER=_iodined
+ GROUP=${USER}
+ PW=/usr/sbin/pw
+
+ if ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ echo "To delete the ${USER} group permanently, use '${PW} groupdel ${GROUP}'."
+ else
+ ${PW} groupdel ${USER}
+ fi
+ fi
+
+ if ${PW} usershow "${USER}" 2>/dev/null 1>&2; then
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ echo "To delete the ${USER} user permanently, use '${PW} userdel ${USER}'."
+ else
+ ${PW} userdel ${USER}
+ fi
+ fi
+
+ exit 0
+ ;;
+esac
diff --git a/net/iodine/pkg-install b/net/iodine/pkg-install
new file mode 100644
index 000000000000..853b8f374878
--- /dev/null
+++ b/net/iodine/pkg-install
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+case $2 in
+POST-INSTALL)
+ USER=_iodined
+ GROUP=${USER}
+ UID=353
+ GID=${UID}
+ PW=/usr/sbin/pw
+
+ if ${PW} group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if ${PW} groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+ if ${PW} user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d "/var/empty" -s /sbin/nologin -c "OSPF Daemon"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi
+ exit 0
+ ;;
+esac
diff --git a/net/iodine/pkg-message b/net/iodine/pkg-message
index 4d92bce671bc..91ab68e89aa8 100644
--- a/net/iodine/pkg-message
+++ b/net/iodine/pkg-message
@@ -1,19 +1,25 @@
+To start iodined at boot, put these lines to your rc.conf:
-=== Quick Start ===
+ iodined_enable="YES"
+ iodined_password="Passw0rd" # tunnel password
+ iodined_domain="t.example.net" # tunnel domain
-Server:
+Note that the password is visible from process list. The default ip
+on the tunnel interface is set to 172.16.0.1. You can change it with
+the ``iodined_addr'' variable in rc.conf.
-iodined -f -u nobody 10.0.0.1 tunnelhost.example.net
+You need to delegate the tunnel domain for iodined use. Add things
+like these to the DNS zone file:
-Client:
+ iodined IN A 192.0.2.1
+ t IN NS iodined.example.net.
-iodine -f -u nobody 192.168.1.1 tunnelhost.example.net
+Replace 192.0.2.1 with your server's (the one you run iodined) IP.
-You need add these lines to the DNS zone file:
+To run the client,
-tunnelhost IN A 192.168.1.1
-tunnel IN NS tunnelhost.example.net
+ iodine -f -u _iodined -t /var/empty 192.168.1.1 t.example.net
-The server side of the tunnel is 10.0.0.1.
+Replace 192.168.1.1 with your DNS server.
-Please check README for details.
+See iodine(1) for more information.