summaryrefslogtreecommitdiff
path: root/net/dtcp/files
diff options
context:
space:
mode:
authorhamajima <hamajima>2004-06-05 07:43:25 +0000
committerhamajima <hamajima>2004-06-05 07:43:25 +0000
commit83ff1834942e26d58b5983674ca0b3acc2544b7c (patch)
treeded80ec0f774142dbf6eee56375d0957df77acdc /net/dtcp/files
parentb9f5b404642a70412481539704c2725bbaaba0c1 (diff)
downloadpkgsrc-83ff1834942e26d58b5983674ca0b3acc2544b7c.tar.gz
New package for dtcp-20030228, Dynamic Tunnel Configuration Protocol daemon and client
Diffstat (limited to 'net/dtcp/files')
-rwxr-xr-xnet/dtcp/files/dtcpc.sh42
-rwxr-xr-xnet/dtcp/files/dtcps.sh64
2 files changed, 106 insertions, 0 deletions
diff --git a/net/dtcp/files/dtcpc.sh b/net/dtcp/files/dtcpc.sh
new file mode 100755
index 00000000000..51a94af2cf6
--- /dev/null
+++ b/net/dtcp/files/dtcpc.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# $FreeBSD: /repoman/r/pcvs/ports/net/dtcp/files/dtcpc.sh,v 1.1 2004/04/19 18:40:52 ume Exp $
+# $NetBSD: dtcpc.sh,v 1.1.1.1 2004/06/05 07:43:25 hamajima Exp $
+#
+
+# PROVIDE: dtcpc
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+#
+# NOTE for FreeBSD 5.0+:
+# If you want this script to start with the base rc scripts
+# move dtcpc.sh to /etc/rc.d/dtcpc
+
+prefix=@PREFIX@
+
+# Define these dtcpc_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/dtcpc
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+dtcpc_enable=${dtcpc_enable:-"NO"} # Enable dtcpc
+#dtcpc_program="${prefix}/sbin/dtcpc" # Location of dtcpc
+dtcpc_server=${dtcpc_server:-""} # DTCP server name
+dtcpc_username=${dtcpc_username:-""} # DTCP user name
+dtcpc_flags=${dtcpc_flags:-"-t network -Dl"} # Flags to dtcpc program
+
+. /etc/rc.subr
+
+name="dtcpc"
+rcvar=$name
+command="${prefix}/sbin/${name}"
+command_interpreter="${prefix}/bin/ruby"
+pidfile="/var/run/${name}.pid"
+extra_commands="reload"
+
+load_rc_config $name
+command_args="${dtcpc_flags} -u ${dtcpc_username} ${dtcpc_server}"
+run_rc_command "$1"
diff --git a/net/dtcp/files/dtcps.sh b/net/dtcp/files/dtcps.sh
new file mode 100755
index 00000000000..102db28cf4c
--- /dev/null
+++ b/net/dtcp/files/dtcps.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# $FreeBSD: /repoman/r/pcvs/ports/net/dtcp/files/dtcps.sh,v 1.1 2004/04/19 18:40:52 ume Exp $
+# $NetBSD: dtcps.sh,v 1.1.1.1 2004/06/05 07:43:25 hamajima Exp $
+#
+
+# PROVIDE: dtcps
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+#
+# NOTE for FreeBSD 5.0+:
+# If you want this script to start with the base rc scripts
+# move dtcps.sh to /etc/rc.d/dtcps
+
+prefix=@PREFIX@
+
+# Define these dtcps_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/dtcps
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+dtcps_enable=${dtcps_enable:-"NO"} # Enable dtcps
+#dtcps_program="${prefix}/sbin/dtcps" # Location of dtcps
+dtcps_tunif=${dtcps_tunif:-""} # tunnel interface
+dtcps_prefix=${dtcps_prefix:-""} # prefix for host tunnel type
+dtcps_flags=${dtcps_flags:-""} # Flags to dtcps program
+
+# interface cloning example
+#dtcps_tunif='gif70'
+
+# static allocation example
+#dtcps_unit_min=70
+#dtcps_unit_max=79
+#dtcps_tunif='gif7[0-9]'
+
+# prefix for host tunnel type.
+# YOU MUST CHANGE TO ASSIGN THIS WITHIN YOUR ADDRESS BLOCK.
+#dtcps_prefix='3ffe:501:185b:8000::'
+
+. /etc/rc.subr
+
+name="dtcps"
+rcvar=$name
+command="${prefix}/sbin/${name}"
+command_interpreter="${prefix}/bin/ruby"
+pidfile="/var/run/${name}.pid"
+start_precmd="dtcps_prestart"
+
+dtcps_prestart() {
+ if [ -n "${dtcps_unit_min}" -a -n "${dtcps_unit_max}" ]; then
+ unit=${dtcps_unit_min}
+ while [ ${unit} -le ${dtcps_unit_max} ]; do
+ ifconfig gif${unit} create >/dev/null 2>&1
+ unit=$((${unit}+1))
+ done
+ fi
+}
+
+load_rc_config $name
+command_args="-i ${dtcps_tunif} ${dtcps_flags} ${dtcps_prefix}"
+run_rc_command "$1"