From 9b603a25143236df5bb468b670ab181523f1db61 Mon Sep 17 00:00:00 2001 From: garbled Date: Wed, 25 Apr 2001 03:43:25 +0000 Subject: [PATCH] Whew. Add an entire networking configuration tree for sushi. This gives sushi the ability to do the following tasks: Edit /etc/exports Edit /etc/hosts Change the hostname Modify NIC configuration Change the default route Setup YP/NIS. --- share/sushi/index | 3 +- share/sushi/network/Makefile | 11 ++ share/sushi/network/exports/Makefile | 11 ++ .../sushi/network/exports/addexport/Makefile | 11 ++ share/sushi/network/exports/addexport/form | 13 ++ share/sushi/network/exports/addexport/help | 26 +++ share/sushi/network/exports/addexport/preform | 2 + share/sushi/network/exports/addexport/script | 53 ++++++ share/sushi/network/exports/addexport/script1 | 3 + share/sushi/network/exports/addexport/script2 | 11 ++ share/sushi/network/exports/addexport/script3 | 13 ++ share/sushi/network/exports/addexport/script4 | 2 + share/sushi/network/exports/addexport/script5 | 11 ++ share/sushi/network/exports/addexport/script6 | 11 ++ share/sushi/network/exports/addexport/script7 | 11 ++ share/sushi/network/exports/addexport/script8 | 9 + share/sushi/network/exports/addexport/script9 | 9 + share/sushi/network/exports/addexport/scripta | 10 ++ share/sushi/network/exports/addexport/scriptb | 11 ++ .../sushi/network/exports/delexport/Makefile | 10 ++ share/sushi/network/exports/delexport/form | 3 + share/sushi/network/exports/delexport/help | 5 + share/sushi/network/exports/delexport/script | 24 +++ share/sushi/network/exports/delexport/script1 | 4 + share/sushi/network/exports/help | 9 + share/sushi/network/exports/index | 3 + share/sushi/network/help | 27 +++ share/sushi/network/hostname/Makefile | 10 ++ share/sushi/network/hostname/form | 3 + share/sushi/network/hostname/help | 6 + share/sushi/network/hostname/script | 14 ++ share/sushi/network/hostname/script1 | 8 + share/sushi/network/hosts/Makefile | 11 ++ share/sushi/network/hosts/addhost/Makefile | 10 ++ share/sushi/network/hosts/addhost/form | 3 + share/sushi/network/hosts/addhost/help | 4 + share/sushi/network/hosts/addhost/script | 9 + share/sushi/network/hosts/addv6host/Makefile | 10 ++ share/sushi/network/hosts/addv6host/form | 3 + share/sushi/network/hosts/addv6host/help | 4 + share/sushi/network/hosts/addv6host/script | 9 + share/sushi/network/hosts/delhost/Makefile | 10 ++ share/sushi/network/hosts/delhost/form | 2 + share/sushi/network/hosts/delhost/help | 3 + share/sushi/network/hosts/delhost/script | 14 ++ share/sushi/network/hosts/delhost/script1 | 3 + share/sushi/network/hosts/help | 16 ++ share/sushi/network/hosts/index | 7 + share/sushi/network/hosts/modhost/Makefile | 10 ++ share/sushi/network/hosts/modhost/form | 4 + share/sushi/network/hosts/modhost/help | 4 + share/sushi/network/hosts/modhost/preform | 2 + share/sushi/network/hosts/modhost/script | 11 ++ share/sushi/network/hosts/modhost/script1 | 4 + share/sushi/network/hosts/modhost/script2 | 6 + share/sushi/network/hosts/modv6host/Makefile | 10 ++ share/sushi/network/hosts/modv6host/form | 4 + share/sushi/network/hosts/modv6host/help | 4 + share/sushi/network/hosts/modv6host/preform | 2 + share/sushi/network/hosts/modv6host/script | 11 ++ share/sushi/network/hosts/modv6host/script1 | 4 + share/sushi/network/hosts/modv6host/script2 | 6 + share/sushi/network/index | 7 + share/sushi/network/interfaces/Makefile | 11 ++ share/sushi/network/interfaces/help | 12 ++ share/sushi/network/interfaces/index | 3 + .../network/interfaces/interface/Makefile | 10 ++ share/sushi/network/interfaces/interface/form | 15 ++ share/sushi/network/interfaces/interface/help | 7 + .../network/interfaces/interface/preform | 2 + .../sushi/network/interfaces/interface/script | 108 ++++++++++++ .../network/interfaces/interface/script1 | 6 + .../network/interfaces/interface/script2 | 157 ++++++++++++++++++ .../sushi/network/interfaces/listif/Makefile | 8 + share/sushi/network/interfaces/listif/script | 23 +++ share/sushi/network/routing/Makefile | 11 ++ share/sushi/network/routing/default/Makefile | 10 ++ share/sushi/network/routing/default/form | 3 + share/sushi/network/routing/default/help | 5 + share/sushi/network/routing/default/script | 15 ++ share/sushi/network/routing/default/script1 | 11 ++ share/sushi/network/routing/help | 5 + share/sushi/network/routing/index | 3 + .../sushi/network/routing/ipv4table/Makefile | 8 + share/sushi/network/routing/ipv4table/exec | 1 + share/sushi/network/yp/Makefile | 11 ++ share/sushi/network/yp/client/Makefile | 10 ++ share/sushi/network/yp/client/form | 2 + share/sushi/network/yp/client/help | 5 + share/sushi/network/yp/client/script | 13 ++ share/sushi/network/yp/client/script1 | 8 + share/sushi/network/yp/domainname/Makefile | 10 ++ share/sushi/network/yp/domainname/form | 3 + share/sushi/network/yp/domainname/help | 6 + share/sushi/network/yp/domainname/script | 14 ++ share/sushi/network/yp/domainname/script1 | 8 + share/sushi/network/yp/help | 11 ++ share/sushi/network/yp/index | 6 + share/sushi/network/yp/master/Makefile | 10 ++ share/sushi/network/yp/master/form | 2 + share/sushi/network/yp/master/help | 5 + share/sushi/network/yp/master/script | 13 ++ share/sushi/network/yp/master/script1 | 8 + share/sushi/network/yp/slave/Makefile | 10 ++ share/sushi/network/yp/slave/form | 3 + share/sushi/network/yp/slave/help | 5 + share/sushi/network/yp/slave/script | 13 ++ share/sushi/network/yp/slave/script1 | 8 + 108 files changed, 1181 insertions(+), 1 deletion(-) create mode 100644 share/sushi/network/Makefile create mode 100644 share/sushi/network/exports/Makefile create mode 100644 share/sushi/network/exports/addexport/Makefile create mode 100644 share/sushi/network/exports/addexport/form create mode 100644 share/sushi/network/exports/addexport/help create mode 100644 share/sushi/network/exports/addexport/preform create mode 100755 share/sushi/network/exports/addexport/script create mode 100755 share/sushi/network/exports/addexport/script1 create mode 100755 share/sushi/network/exports/addexport/script2 create mode 100755 share/sushi/network/exports/addexport/script3 create mode 100755 share/sushi/network/exports/addexport/script4 create mode 100755 share/sushi/network/exports/addexport/script5 create mode 100755 share/sushi/network/exports/addexport/script6 create mode 100755 share/sushi/network/exports/addexport/script7 create mode 100755 share/sushi/network/exports/addexport/script8 create mode 100755 share/sushi/network/exports/addexport/script9 create mode 100755 share/sushi/network/exports/addexport/scripta create mode 100755 share/sushi/network/exports/addexport/scriptb create mode 100644 share/sushi/network/exports/delexport/Makefile create mode 100644 share/sushi/network/exports/delexport/form create mode 100644 share/sushi/network/exports/delexport/help create mode 100755 share/sushi/network/exports/delexport/script create mode 100755 share/sushi/network/exports/delexport/script1 create mode 100644 share/sushi/network/exports/help create mode 100644 share/sushi/network/exports/index create mode 100644 share/sushi/network/help create mode 100644 share/sushi/network/hostname/Makefile create mode 100644 share/sushi/network/hostname/form create mode 100644 share/sushi/network/hostname/help create mode 100755 share/sushi/network/hostname/script create mode 100755 share/sushi/network/hostname/script1 create mode 100644 share/sushi/network/hosts/Makefile create mode 100644 share/sushi/network/hosts/addhost/Makefile create mode 100644 share/sushi/network/hosts/addhost/form create mode 100644 share/sushi/network/hosts/addhost/help create mode 100755 share/sushi/network/hosts/addhost/script create mode 100644 share/sushi/network/hosts/addv6host/Makefile create mode 100644 share/sushi/network/hosts/addv6host/form create mode 100644 share/sushi/network/hosts/addv6host/help create mode 100755 share/sushi/network/hosts/addv6host/script create mode 100644 share/sushi/network/hosts/delhost/Makefile create mode 100644 share/sushi/network/hosts/delhost/form create mode 100644 share/sushi/network/hosts/delhost/help create mode 100755 share/sushi/network/hosts/delhost/script create mode 100755 share/sushi/network/hosts/delhost/script1 create mode 100644 share/sushi/network/hosts/help create mode 100644 share/sushi/network/hosts/index create mode 100644 share/sushi/network/hosts/modhost/Makefile create mode 100644 share/sushi/network/hosts/modhost/form create mode 100644 share/sushi/network/hosts/modhost/help create mode 100644 share/sushi/network/hosts/modhost/preform create mode 100755 share/sushi/network/hosts/modhost/script create mode 100755 share/sushi/network/hosts/modhost/script1 create mode 100755 share/sushi/network/hosts/modhost/script2 create mode 100644 share/sushi/network/hosts/modv6host/Makefile create mode 100644 share/sushi/network/hosts/modv6host/form create mode 100644 share/sushi/network/hosts/modv6host/help create mode 100644 share/sushi/network/hosts/modv6host/preform create mode 100755 share/sushi/network/hosts/modv6host/script create mode 100755 share/sushi/network/hosts/modv6host/script1 create mode 100755 share/sushi/network/hosts/modv6host/script2 create mode 100644 share/sushi/network/index create mode 100644 share/sushi/network/interfaces/Makefile create mode 100644 share/sushi/network/interfaces/help create mode 100644 share/sushi/network/interfaces/index create mode 100644 share/sushi/network/interfaces/interface/Makefile create mode 100644 share/sushi/network/interfaces/interface/form create mode 100644 share/sushi/network/interfaces/interface/help create mode 100644 share/sushi/network/interfaces/interface/preform create mode 100755 share/sushi/network/interfaces/interface/script create mode 100755 share/sushi/network/interfaces/interface/script1 create mode 100755 share/sushi/network/interfaces/interface/script2 create mode 100644 share/sushi/network/interfaces/listif/Makefile create mode 100755 share/sushi/network/interfaces/listif/script create mode 100644 share/sushi/network/routing/Makefile create mode 100644 share/sushi/network/routing/default/Makefile create mode 100644 share/sushi/network/routing/default/form create mode 100644 share/sushi/network/routing/default/help create mode 100755 share/sushi/network/routing/default/script create mode 100755 share/sushi/network/routing/default/script1 create mode 100644 share/sushi/network/routing/help create mode 100644 share/sushi/network/routing/index create mode 100644 share/sushi/network/routing/ipv4table/Makefile create mode 100644 share/sushi/network/routing/ipv4table/exec create mode 100644 share/sushi/network/yp/Makefile create mode 100644 share/sushi/network/yp/client/Makefile create mode 100644 share/sushi/network/yp/client/form create mode 100644 share/sushi/network/yp/client/help create mode 100755 share/sushi/network/yp/client/script create mode 100755 share/sushi/network/yp/client/script1 create mode 100644 share/sushi/network/yp/domainname/Makefile create mode 100644 share/sushi/network/yp/domainname/form create mode 100644 share/sushi/network/yp/domainname/help create mode 100755 share/sushi/network/yp/domainname/script create mode 100755 share/sushi/network/yp/domainname/script1 create mode 100644 share/sushi/network/yp/help create mode 100644 share/sushi/network/yp/index create mode 100644 share/sushi/network/yp/master/Makefile create mode 100644 share/sushi/network/yp/master/form create mode 100644 share/sushi/network/yp/master/help create mode 100755 share/sushi/network/yp/master/script create mode 100755 share/sushi/network/yp/master/script1 create mode 100644 share/sushi/network/yp/slave/Makefile create mode 100644 share/sushi/network/yp/slave/form create mode 100644 share/sushi/network/yp/slave/help create mode 100755 share/sushi/network/yp/slave/script create mode 100755 share/sushi/network/yp/slave/script1 diff --git a/share/sushi/index b/share/sushi/index index e1db3feb4fd4..96a09539ad1c 100644 --- a/share/sushi/index +++ b/share/sushi/index @@ -1,7 +1,8 @@ -# $NetBSD: index,v 1.3 2001/03/07 07:05:08 garbled Exp $ +# $NetBSD: index,v 1.4 2001/04/25 03:43:25 garbled Exp $ install install Software Installation and Maintenance system system System Maintenance users users Security & Users +network network Network related configuration BLANK BLANK BLANK info info Using sushi (information only) util util Sushi utilities (logging/scripting) diff --git a/share/sushi/network/Makefile b/share/sushi/network/Makefile new file mode 100644 index 000000000000..d28d3e3da709 --- /dev/null +++ b/share/sushi/network/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:25 garbled Exp $ + +SUBDIR= exports hostname hosts interfaces routing yp + +FILES= index help +FILESDIR=${BINDIR}/sushi/network +MKOBJ= no + +.include "../../Makefile.inc" +.include +.include diff --git a/share/sushi/network/exports/Makefile b/share/sushi/network/exports/Makefile new file mode 100644 index 000000000000..e265ad81c288 --- /dev/null +++ b/share/sushi/network/exports/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:25 garbled Exp $ + +SUBDIR= addexport delexport + +FILES= index help +FILESDIR=${BINDIR}/sushi/network/exports +MKOBJ= no + +.include "../../Makefile.inc" +.include +.include diff --git a/share/sushi/network/exports/addexport/Makefile b/share/sushi/network/exports/addexport/Makefile new file mode 100644 index 000000000000..5130478ad925 --- /dev/null +++ b/share/sushi/network/exports/addexport/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:26 garbled Exp $ + +FILES= form preform help +FILESDIR=${BINDIR}/sushi/network/exports/addexport +SCRIPTS= script1 script2 script3 script4 script5 script6 +SCRIPTS+= script7 script8 script9 scripta scriptb script +SCRIPTSDIR=${BINDIR}/sushi/network/exports/addexport +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/exports/addexport/form b/share/sushi/network/exports/addexport/form new file mode 100644 index 000000000000..df246f947212 --- /dev/null +++ b/share/sushi/network/exports/addexport/form @@ -0,0 +1,13 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:26 garbled Exp $ +noedit:@@@1@@@ Filesystem to export +script:script2,@@@1@@@ Export all subdirectories? +script:scriptb,@@@1@@@ Map root access to a user/group? +script:script3,@@@1@@@ User to map root access to +multiscript:script4,@@@1@@@ Groups to map root access to +script:script5,@@@1@@@ Export filesystem read-only? +script:script6,@@@1@@@ Allow NFS connections from unreserved ports? +script:script7,@@@1@@@ Allow mount connections from unreserved ports? +escript:50,script8,@@@1@@@ Network to export mount to +escript:15,script9,@@@1@@@ Netmask to apply to above network +escript:80,scripta,@@@1@@@ Hosts/netgroups to export mount to +list:YES,NO Restart mountd so changes take effect? diff --git a/share/sushi/network/exports/addexport/help b/share/sushi/network/exports/addexport/help new file mode 100644 index 000000000000..8cc4302e84ce --- /dev/null +++ b/share/sushi/network/exports/addexport/help @@ -0,0 +1,26 @@ +Under NetBSD, you may only export a complete filesystem, you cannot +export a subdirectory of a filesystem. Therefore only filesystem mount +points will be displayed to you. + +If you choose to export all subdirectories, clients may mount any +subdirectory of the mount point, rather than the entire mount point. + +Mapping root access to a specific user or group means that root on the +client machine, will have the access permissions of the user/group selected. + +Allowing unreserved port connections may sometimes be needed for less secure +client implementations. Using this option will decrease the security of your +system. + +Setting the network and netmask allows you to export a filesystem to an +entire network, or subnet. + +Hosts/netgroups to export mount to, allows you to specify individual hosts, +or netgroups as may be defined in an /etc/netgroup file, that are allowed to +mount filesystems from this host. You may specify IP's, hostnames, or +netgroups. Multiple hosts to export to should be space separated. + +For more information and details on exporting filesystems, please see the +exports(5) manpage. + +$NetBSD: help,v 1.1 2001/04/25 03:43:26 garbled Exp $ diff --git a/share/sushi/network/exports/addexport/preform b/share/sushi/network/exports/addexport/preform new file mode 100644 index 000000000000..408fdb2b001e --- /dev/null +++ b/share/sushi/network/exports/addexport/preform @@ -0,0 +1,2 @@ +# $NetBSD: preform,v 1.1 2001/04/25 03:43:26 garbled Exp $ +script:script1 Filesystem to export diff --git a/share/sushi/network/exports/addexport/script b/share/sushi/network/exports/addexport/script new file mode 100755 index 000000000000..67ac7f87d2b8 --- /dev/null +++ b/share/sushi/network/exports/addexport/script @@ -0,0 +1,53 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:26 garbled Exp $ + +IFS=" " +EXPORTS=`cat /etc/exports` +echo $EXPORTS | grep -v "^$1" | grep -v '^$' >/etc/exports +LINE="$1" + +if [ "$2" = "YES" ]; then + LINE=`echo "$LINE -alldirs"` +fi +if [ "$3" = "YES" ]; then + LINE=`echo "$LINE -maproot=$4"` + if [ "$5" != " " ]; then + GROUPS=`echo "$5" | sed -e 's/,/:/g'` + LINE=`echo "$LINE"":$GROUPS"` + fi +fi +if [ "$6" = "YES" ]; then + LINE=`echo "$LINE -ro"` +fi +if [ "$7" = "YES" ]; then + LINE=`echo "$LINE -noresvport"` +fi +if [ "$8" = "YES" ]; then + LINE=`echo "$LINE -noresvmnt"` +fi +if [ "$9" != " " ]; then + LINE=`echo "$LINE -network $9"` +fi +if [ "$10" != " " ]; then + LINE=`echo "$LINE -mask $10"` +fi +if [ "$11" != " " ]; then + LINE=`echo "$LINE $11"` +fi + +echo $LINE >>/etc/exports + +if [ "$?" = "0" ]; then + echo "Added or modified $1 in /etc/exports" +else + echo "Failed to modify /etc/exports" +fi + +if [ "$12" = "YES" ]; then + if [ -f "/var/run/mountd.pid" ]; then + kill -HUP `cat /var/run/mountd.pid` + echo "Restarted mountd." + else + echo "Mountd not running, cannot refresh." + fi +fi diff --git a/share/sushi/network/exports/addexport/script1 b/share/sushi/network/exports/addexport/script1 new file mode 100755 index 000000000000..7e64bf2d40ee --- /dev/null +++ b/share/sushi/network/exports/addexport/script1 @@ -0,0 +1,3 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:27 garbled Exp $ +df -l | egrep -v '(procfs|kernfs|mfs)' | awk '{print $6}' | grep -v Mounted diff --git a/share/sushi/network/exports/addexport/script2 b/share/sushi/network/exports/addexport/script2 new file mode 100755 index 000000000000..d387b33ecc85 --- /dev/null +++ b/share/sushi/network/exports/addexport/script2 @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: script2,v 1.1 2001/04/25 03:43:27 garbled Exp $ + +grep "^$1 " /etc/exports | grep -- '-alldirs' > /dev/null +if [ "$?" = "0" ]; then + echo "YES" + echo "NO" +else + echo "NO" + echo "YES" +fi diff --git a/share/sushi/network/exports/addexport/script3 b/share/sushi/network/exports/addexport/script3 new file mode 100755 index 000000000000..4ecba5feb6dd --- /dev/null +++ b/share/sushi/network/exports/addexport/script3 @@ -0,0 +1,13 @@ +#!/bin/sh +# $NetBSD: script3,v 1.1 2001/04/25 03:43:27 garbled Exp $ + +MAPROOT=`grep "$1 " /etc/exports | grep -- '-maproot'` +if [ $? != 0 ]; then + cut -f 1 -d ':' /etc/passwd +else + MAPROOT=`echo $MAPROOT | sed -e 's/.*-maproot=\(.*\) *.*/\1/'` + USER=`echo $MAPROOT | cut -f 1 -d ':'` + USER=`id -p $USER | grep uid | awk '{print $2}'` + echo $USER + cut -f 1 -d ':' /etc/passwd | grep -v "$USER$" +fi diff --git a/share/sushi/network/exports/addexport/script4 b/share/sushi/network/exports/addexport/script4 new file mode 100755 index 000000000000..f2e0003c1304 --- /dev/null +++ b/share/sushi/network/exports/addexport/script4 @@ -0,0 +1,2 @@ +#!/bin/sh +cut -f 1 -d : /etc/group diff --git a/share/sushi/network/exports/addexport/script5 b/share/sushi/network/exports/addexport/script5 new file mode 100755 index 000000000000..b807ce05891c --- /dev/null +++ b/share/sushi/network/exports/addexport/script5 @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: script5,v 1.1 2001/04/25 03:43:27 garbled Exp $ + +grep "^$1 " /etc/exports | grep -- '-ro' > /dev/null +if [ "$?" = "0" ]; then + echo "YES" + echo "NO" +else + echo "NO" + echo "YES" +fi diff --git a/share/sushi/network/exports/addexport/script6 b/share/sushi/network/exports/addexport/script6 new file mode 100755 index 000000000000..642a971a50e8 --- /dev/null +++ b/share/sushi/network/exports/addexport/script6 @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: script6,v 1.1 2001/04/25 03:43:27 garbled Exp $ + +grep "^$1 " /etc/exports | grep -- '-noresvport' > /dev/null +if [ "$?" = "0" ]; then + echo "YES" + echo "NO" +else + echo "NO" + echo "YES" +fi diff --git a/share/sushi/network/exports/addexport/script7 b/share/sushi/network/exports/addexport/script7 new file mode 100755 index 000000000000..d000daeda833 --- /dev/null +++ b/share/sushi/network/exports/addexport/script7 @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: script7,v 1.1 2001/04/25 03:43:27 garbled Exp $ + +grep "^$1 " /etc/exports | grep -- '-noresvmnt' > /dev/null +if [ "$?" = "0" ]; then + echo "YES" + echo "NO" +else + echo "NO" + echo "YES" +fi diff --git a/share/sushi/network/exports/addexport/script8 b/share/sushi/network/exports/addexport/script8 new file mode 100755 index 000000000000..0bef57da7c7b --- /dev/null +++ b/share/sushi/network/exports/addexport/script8 @@ -0,0 +1,9 @@ +#!/bin/sh +# $NetBSD: script8,v 1.1 2001/04/25 03:43:28 garbled Exp $ + +NETWORK=`grep "^$1 " /etc/exports | grep -- '-network' | sed -e 's/.*-network \([a-zA-Z0-9.:%/]*\) *.*/\1/'` +if [ -z "$NETWORK" ]; then + echo " " +else + echo $NETWORK +fi diff --git a/share/sushi/network/exports/addexport/script9 b/share/sushi/network/exports/addexport/script9 new file mode 100755 index 000000000000..2de4ed3f7050 --- /dev/null +++ b/share/sushi/network/exports/addexport/script9 @@ -0,0 +1,9 @@ +#!/bin/sh +# $NetBSD: script9,v 1.1 2001/04/25 03:43:28 garbled Exp $ + +NETWORK=`grep "^$1 " /etc/exports | grep -- '-mask' | sed -e 's/.*-mask \([a-zA-Z0-9.:%/]*\) *.*/\1/'` +if [ -z "$NETWORK" ]; then + echo " " +else + echo $NETWORK +fi diff --git a/share/sushi/network/exports/addexport/scripta b/share/sushi/network/exports/addexport/scripta new file mode 100755 index 000000000000..2753276ad83d --- /dev/null +++ b/share/sushi/network/exports/addexport/scripta @@ -0,0 +1,10 @@ +#!/bin/sh +# $NetBSD: scripta,v 1.1 2001/04/25 03:43:28 garbled Exp $ +LIST=`grep "^$1 " /etc/exports | sed -e 's/-network [a-zA-Z0-9.:%/]*//g' \ + | sed -e 's/-mask [a-zA-Z0-9.:%/]*//g' | sed -e 's/-[a-zA-Z0-9=:]*//g' \ + | sed -e "s@$1@@"` +if [ -z "$LIST" ]; then + echo +else + echo "$LIST" +fi diff --git a/share/sushi/network/exports/addexport/scriptb b/share/sushi/network/exports/addexport/scriptb new file mode 100755 index 000000000000..2f9b56bcfe4f --- /dev/null +++ b/share/sushi/network/exports/addexport/scriptb @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: scriptb,v 1.1 2001/04/25 03:43:28 garbled Exp $ + +grep "^$1 " /etc/exports | grep -- '-maproot' > /dev/null +if [ "$?" = "0" ]; then + echo "YES" + echo "NO" +else + echo "NO" + echo "YES" +fi diff --git a/share/sushi/network/exports/delexport/Makefile b/share/sushi/network/exports/delexport/Makefile new file mode 100644 index 000000000000..b6572690cf1a --- /dev/null +++ b/share/sushi/network/exports/delexport/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:28 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/exports/delexport +SCRIPTS= script1 script +SCRIPTSDIR=${BINDIR}/sushi/network/exports/delexport +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/exports/delexport/form b/share/sushi/network/exports/delexport/form new file mode 100644 index 000000000000..c55300e3a66a --- /dev/null +++ b/share/sushi/network/exports/delexport/form @@ -0,0 +1,3 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:28 garbled Exp $ +multiscript:script1 Select which entries to delete: +list:YES,NO Restart mountd so changes take effect? diff --git a/share/sushi/network/exports/delexport/help b/share/sushi/network/exports/delexport/help new file mode 100644 index 000000000000..fe31a76cf8d4 --- /dev/null +++ b/share/sushi/network/exports/delexport/help @@ -0,0 +1,5 @@ +Simply choose the exported filesystem that you no longer wish to export +from your machine, and hit enter. The filesystem will be deleted from +your /etc/exports file permanently. + +$NetBSD: help,v 1.1 2001/04/25 03:43:28 garbled Exp $ diff --git a/share/sushi/network/exports/delexport/script b/share/sushi/network/exports/delexport/script new file mode 100755 index 000000000000..bf17a1b82488 --- /dev/null +++ b/share/sushi/network/exports/delexport/script @@ -0,0 +1,24 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:29 garbled Exp $ + +DATA=`echo $1 | sed -e 's@,@ .*%%" | sed -e "s%^@g'` +LIST=`echo $DATA | sed -e 's@,@ .*%%" | sed -e "s%^@g'` +LIST=`echo 'sed -e "s%^'$LIST' .*%%"'` +echo $LIST +IFS=" " +EXPORTS=`cat /etc/exports` +echo $EXPORTS | eval "$LIST" | grep -v '^$' >/etc/exports +if [ "$?" = "0" ]; then + echo "Deleted all selected exports from /etc/exports" +else + echo "Failed to delete exports" +fi +if [ "$2" = "YES" ]; then + if [ -f "/var/run/mountd.pid" ]; then + kill -HUP `cat /var/run/mountd.pid` + echo "Restarted mountd." + else + echo "Mountd not running, cannot refresh." + fi +fi + diff --git a/share/sushi/network/exports/delexport/script1 b/share/sushi/network/exports/delexport/script1 new file mode 100755 index 000000000000..c6bc26cf64d0 --- /dev/null +++ b/share/sushi/network/exports/delexport/script1 @@ -0,0 +1,4 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:29 garbled Exp $ + +cat /etc/exports | grep -v '^$' | grep -v '^#' | awk '{print $1}' diff --git a/share/sushi/network/exports/help b/share/sushi/network/exports/help new file mode 100644 index 000000000000..927cd9e394f7 --- /dev/null +++ b/share/sushi/network/exports/help @@ -0,0 +1,9 @@ +Un-export currently exported filesystems: +This function allows you to remove filesystems from your /etc/exports +file. + +Add or change exported filesystems: +This function allows you to edit existing exported filesystems in your +/etc/exports file, or add new ones. + +$NetBSD: help,v 1.1 2001/04/25 03:43:26 garbled Exp $ diff --git a/share/sushi/network/exports/index b/share/sushi/network/exports/index new file mode 100644 index 000000000000..c08dfe530f2a --- /dev/null +++ b/share/sushi/network/exports/index @@ -0,0 +1,3 @@ +# $NetBSD: index,v 1.1 2001/04/25 03:43:26 garbled Exp $ +delexport delexport Un-export currently exported filesystems +addexport addexport Add or change exported filesystems diff --git a/share/sushi/network/help b/share/sushi/network/help new file mode 100644 index 000000000000..e81982f3cf98 --- /dev/null +++ b/share/sushi/network/help @@ -0,0 +1,27 @@ +This menu provides access to various network configuration functions. + +Show or configure network adapters: +This menu allows you to modify or configure any network adapters (NIC cards) +that might be present on your machine. + +Modify the hosts file: +This menu allows you to modify your /etc/hosts file. You can add, delete or +change entries located in this file. + +Show or configure basic routing: +This menu allows you to view your current routing table, and set your +default route. + +Modify this machine's hostname: +Change or initially set your hostname. + +Modify NFS exported filesystems: +This menu allows you to delete lines (unexport filesystems) in your +/etc/exports file. It will also allow you to add new filesystems to the +export list, or modify parameters for existing ones. + +Setup or Configure NIS/YP: +This menu allows you to set the domainname, or configure this machine as a +NIS master, slave or client. + +$NetBSD: help,v 1.1 2001/04/25 03:43:25 garbled Exp $ diff --git a/share/sushi/network/hostname/Makefile b/share/sushi/network/hostname/Makefile new file mode 100644 index 000000000000..9c1501f1e69b --- /dev/null +++ b/share/sushi/network/hostname/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:29 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/hostname +SCRIPTS= script script1 +SCRIPTSDIR=${BINDIR}/sushi/network/hostname +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/hostname/form b/share/sushi/network/hostname/form new file mode 100644 index 000000000000..1afc5bc43806 --- /dev/null +++ b/share/sushi/network/hostname/form @@ -0,0 +1,3 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:29 garbled Exp $ +escript:40,script1 Hostname of this machine +list:both,now,boot Modify hostname now, at boot-time, or both? diff --git a/share/sushi/network/hostname/help b/share/sushi/network/hostname/help new file mode 100644 index 000000000000..9e941c37f626 --- /dev/null +++ b/share/sushi/network/hostname/help @@ -0,0 +1,6 @@ +You may modify your system's hostname using this form. Setting it for +boot time, will only modify the /etc/myname file, and take effect on your +next reboot. Setting it now, will only modify the running hostname. By +selecting both, you can permanently change your hostname, immediately. + +$NetBSD: help,v 1.1 2001/04/25 03:43:29 garbled Exp $ diff --git a/share/sushi/network/hostname/script b/share/sushi/network/hostname/script new file mode 100755 index 000000000000..831127d63c03 --- /dev/null +++ b/share/sushi/network/hostname/script @@ -0,0 +1,14 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:29 garbled Exp $ + +if [ "$2" = "both" -o "$2" = "boot" ]; then + echo "$1" >/etc/myname +fi +if [ "$2" = "both" -o "$2" = "now" ]; then + hostname $1 +fi +if [ "$?" = "0" ]; then + echo "Hostname has been changed to $1" +else + echo "Failed to change hostname to $1" +fi diff --git a/share/sushi/network/hostname/script1 b/share/sushi/network/hostname/script1 new file mode 100755 index 000000000000..714152c8e720 --- /dev/null +++ b/share/sushi/network/hostname/script1 @@ -0,0 +1,8 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:29 garbled Exp $ + +if [ -f "/etc/myname" ]; then + cat /etc/myname +else + hostname -s +fi diff --git a/share/sushi/network/hosts/Makefile b/share/sushi/network/hosts/Makefile new file mode 100644 index 000000000000..301a99b2ea07 --- /dev/null +++ b/share/sushi/network/hosts/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:29 garbled Exp $ + +SUBDIR= addhost addv6host delhost modhost modv6host + +FILES= index help +FILESDIR=${BINDIR}/sushi/network/hosts +MKOBJ= no + +.include "../../Makefile.inc" +.include +.include diff --git a/share/sushi/network/hosts/addhost/Makefile b/share/sushi/network/hosts/addhost/Makefile new file mode 100644 index 000000000000..34a925710cfa --- /dev/null +++ b/share/sushi/network/hosts/addhost/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:30 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/hosts/addhost +SCRIPTS= script +SCRIPTSDIR=${BINDIR}/sushi/network/hosts/addhost +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/hosts/addhost/form b/share/sushi/network/hosts/addhost/form new file mode 100644 index 000000000000..0c2181b1001b --- /dev/null +++ b/share/sushi/network/hosts/addhost/form @@ -0,0 +1,3 @@ +req-entry:40 Hostname +req-ipv4: IPV4 address +entry:40 Optional Aliases (space separated) diff --git a/share/sushi/network/hosts/addhost/help b/share/sushi/network/hosts/addhost/help new file mode 100644 index 000000000000..9251bcd7a745 --- /dev/null +++ b/share/sushi/network/hosts/addhost/help @@ -0,0 +1,4 @@ +Specify the hostname, network address, and any aliases for the host as a +space separated list. + +$NetBSD: help,v 1.1 2001/04/25 03:43:30 garbled Exp $ diff --git a/share/sushi/network/hosts/addhost/script b/share/sushi/network/hosts/addhost/script new file mode 100755 index 000000000000..2d0d99753c8d --- /dev/null +++ b/share/sushi/network/hosts/addhost/script @@ -0,0 +1,9 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:30 garbled Exp $ + +echo "$2 $1 $3" >>/etc/hosts +if [ "$?" = "0" ]; then + echo "Added host $1 to /etc/hosts" +else + echo "Failed to add host $1" +fi diff --git a/share/sushi/network/hosts/addv6host/Makefile b/share/sushi/network/hosts/addv6host/Makefile new file mode 100644 index 000000000000..e5d0680ea2f1 --- /dev/null +++ b/share/sushi/network/hosts/addv6host/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:30 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/hosts/addv6host +SCRIPTS= script +SCRIPTSDIR=${BINDIR}/sushi/network/hosts/addv6host +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/hosts/addv6host/form b/share/sushi/network/hosts/addv6host/form new file mode 100644 index 000000000000..7b790ef61da4 --- /dev/null +++ b/share/sushi/network/hosts/addv6host/form @@ -0,0 +1,3 @@ +req-entry:40 Hostname +req-ipv6: IPV6 address +entry:40 Optional Aliases (space separated) diff --git a/share/sushi/network/hosts/addv6host/help b/share/sushi/network/hosts/addv6host/help new file mode 100644 index 000000000000..df791d167661 --- /dev/null +++ b/share/sushi/network/hosts/addv6host/help @@ -0,0 +1,4 @@ +Specify the hostname, network address, and any aliases for the host as a +space separated list. + +$NetBSD: help,v 1.1 2001/04/25 03:43:31 garbled Exp $ diff --git a/share/sushi/network/hosts/addv6host/script b/share/sushi/network/hosts/addv6host/script new file mode 100755 index 000000000000..1ad6d27ac79c --- /dev/null +++ b/share/sushi/network/hosts/addv6host/script @@ -0,0 +1,9 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:31 garbled Exp $ + +echo "$2 $1 $3" >>/etc/hosts +if [ "$?" = "0" ]; then + echo "Added host $1 to /etc/hosts" +else + echo "Failed to add host $1" +fi diff --git a/share/sushi/network/hosts/delhost/Makefile b/share/sushi/network/hosts/delhost/Makefile new file mode 100644 index 000000000000..b31887e0ee9d --- /dev/null +++ b/share/sushi/network/hosts/delhost/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:31 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/hosts/delhost +SCRIPTS= script script1 +SCRIPTSDIR=${BINDIR}/sushi/network/hosts/delhost +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/hosts/delhost/form b/share/sushi/network/hosts/delhost/form new file mode 100644 index 000000000000..c155e2589f97 --- /dev/null +++ b/share/sushi/network/hosts/delhost/form @@ -0,0 +1,2 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:31 garbled Exp $ +multiscript:script1 Select which host entries to delete diff --git a/share/sushi/network/hosts/delhost/help b/share/sushi/network/hosts/delhost/help new file mode 100644 index 000000000000..d505219bc1f6 --- /dev/null +++ b/share/sushi/network/hosts/delhost/help @@ -0,0 +1,3 @@ +Choose the entry you wish to permanently delete from your /etc/hosts file. + +$NetBSD: help,v 1.1 2001/04/25 03:43:31 garbled Exp $ diff --git a/share/sushi/network/hosts/delhost/script b/share/sushi/network/hosts/delhost/script new file mode 100755 index 000000000000..adc4acf73fb7 --- /dev/null +++ b/share/sushi/network/hosts/delhost/script @@ -0,0 +1,14 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:31 garbled Exp $ + +DATA=`echo $1 | sed -e 's@ @\[^A-Za-z0-9_/\\.-\]\*@g'` +LIST=`echo $DATA | sed -e 's@,@.*//" | sed -e "s/^@g'` +LIST=`echo 'sed -e "s/^'$LIST'.*//"'` +IFS=" " +HOSTS=`cat /etc/hosts` +echo $HOSTS | eval "$LIST" >/etc/hosts +if [ "$?" = "0" ]; then + echo "Deleted all selected hosts from /etc/hosts" +else + echo "Failed to delete hosts" +fi diff --git a/share/sushi/network/hosts/delhost/script1 b/share/sushi/network/hosts/delhost/script1 new file mode 100755 index 000000000000..0fb449d8ec20 --- /dev/null +++ b/share/sushi/network/hosts/delhost/script1 @@ -0,0 +1,3 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:31 garbled Exp $ +grep -v '^#' /etc/hosts | grep -v '^$' diff --git a/share/sushi/network/hosts/help b/share/sushi/network/hosts/help new file mode 100644 index 000000000000..9be33c136d77 --- /dev/null +++ b/share/sushi/network/hosts/help @@ -0,0 +1,16 @@ +Add an IPV4 host entry: +You may add a new IPV4 entry to your /etc/hosts file with this form. + +Add an IPV6 host entry: +You may add a new IPV6 entry to your /etc/hosts file with this form. + +Modify an IPV4 host entry: +You can modify an existing IPV4 entry in your /etc/hosts file with this form. + +Modify an IPV6 host entry: +You can modify an existing IPV6 entry in your /etc/hosts file with this form. + +Delete host entries: +Using this form, you can permanently delete an entry in your /etc/hosts file. + +$NetBSD: help,v 1.1 2001/04/25 03:43:30 garbled Exp $ diff --git a/share/sushi/network/hosts/index b/share/sushi/network/hosts/index new file mode 100644 index 000000000000..d290485a0d3c --- /dev/null +++ b/share/sushi/network/hosts/index @@ -0,0 +1,7 @@ +#$NetBSD: index,v 1.1 2001/04/25 03:43:30 garbled Exp $ +addhost addhost Add an IPV4 host entry +addv6host addv6host Add an IPV6 host entry +modhost modhost Modify an IPV4 host entry +modv6host modv6host Modify an IPV6 host entry +delhost delhost Delete host entries + diff --git a/share/sushi/network/hosts/modhost/Makefile b/share/sushi/network/hosts/modhost/Makefile new file mode 100644 index 000000000000..ce215cea80c9 --- /dev/null +++ b/share/sushi/network/hosts/modhost/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:31 garbled Exp $ + +FILES= form preform help +FILESDIR=${BINDIR}/sushi/network/hosts/modhost +SCRIPTS= script script1 script2 +SCRIPTSDIR=${BINDIR}/sushi/network/hosts/modhost +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/hosts/modhost/form b/share/sushi/network/hosts/modhost/form new file mode 100644 index 000000000000..b7899c7fb0f9 --- /dev/null +++ b/share/sushi/network/hosts/modhost/form @@ -0,0 +1,4 @@ +req-escript:40,script2,2,@@@1@@@ Hostname +req-ipv4script:script2,1,@@@1@@@ IPV4 address +escript:40,script2,3,@@@1@@@ Optional Aliases (space separated) +invis:@@@1@@@ diff --git a/share/sushi/network/hosts/modhost/help b/share/sushi/network/hosts/modhost/help new file mode 100644 index 000000000000..f3179e1f63cf --- /dev/null +++ b/share/sushi/network/hosts/modhost/help @@ -0,0 +1,4 @@ +After choosing which entry to edit, specify the hostname, network address, +and any aliases for the host as a space separated list. + +$NetBSD: help,v 1.1 2001/04/25 03:43:32 garbled Exp $ diff --git a/share/sushi/network/hosts/modhost/preform b/share/sushi/network/hosts/modhost/preform new file mode 100644 index 000000000000..9578e77bff12 --- /dev/null +++ b/share/sushi/network/hosts/modhost/preform @@ -0,0 +1,2 @@ +# $NetBSD: preform,v 1.1 2001/04/25 03:43:32 garbled Exp $ +script:script1 Select which host entry to modify diff --git a/share/sushi/network/hosts/modhost/script b/share/sushi/network/hosts/modhost/script new file mode 100755 index 000000000000..a42493117c9f --- /dev/null +++ b/share/sushi/network/hosts/modhost/script @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:32 garbled Exp $ + +IFS=" " +HOSTS=`cat /etc/hosts` +echo $HOSTS | sed -e "s/$4.*/$2 $1 $3/" | >/etc/hosts +if [ "$?" = "0" ]; then + echo "Modified host $1" +else + echo "Failed to modify host $1" +fi diff --git a/share/sushi/network/hosts/modhost/script1 b/share/sushi/network/hosts/modhost/script1 new file mode 100755 index 000000000000..4598854f5ed6 --- /dev/null +++ b/share/sushi/network/hosts/modhost/script1 @@ -0,0 +1,4 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:32 garbled Exp $ +grep -v '^#' /etc/hosts | grep -v '^$' | \ + grep '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' diff --git a/share/sushi/network/hosts/modhost/script2 b/share/sushi/network/hosts/modhost/script2 new file mode 100755 index 000000000000..0bf4c8dba679 --- /dev/null +++ b/share/sushi/network/hosts/modhost/script2 @@ -0,0 +1,6 @@ +#!/bin/sh +# $NetBSD: script2,v 1.1 2001/04/25 03:43:32 garbled Exp $ + +a=`expr $1 + 1` +x=$(echo `eval echo \\$$a`) +echo $x diff --git a/share/sushi/network/hosts/modv6host/Makefile b/share/sushi/network/hosts/modv6host/Makefile new file mode 100644 index 000000000000..04c87cb289b6 --- /dev/null +++ b/share/sushi/network/hosts/modv6host/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:32 garbled Exp $ + +FILES= form preform help +FILESDIR=${BINDIR}/sushi/network/hosts/modv6host +SCRIPTS= script script1 script2 +SCRIPTSDIR=${BINDIR}/sushi/network/hosts/modv6host +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/hosts/modv6host/form b/share/sushi/network/hosts/modv6host/form new file mode 100644 index 000000000000..8fd2d10d4cd8 --- /dev/null +++ b/share/sushi/network/hosts/modv6host/form @@ -0,0 +1,4 @@ +req-escript:40,script2,2,@@@1@@@ Hostname +req-ipv6script:script2,1,@@@1@@@ IPV6 address +escript:40,script2,3,@@@1@@@ Optional Aliases (space separated) +invis:@@@1@@@ diff --git a/share/sushi/network/hosts/modv6host/help b/share/sushi/network/hosts/modv6host/help new file mode 100644 index 000000000000..f3179e1f63cf --- /dev/null +++ b/share/sushi/network/hosts/modv6host/help @@ -0,0 +1,4 @@ +After choosing which entry to edit, specify the hostname, network address, +and any aliases for the host as a space separated list. + +$NetBSD: help,v 1.1 2001/04/25 03:43:32 garbled Exp $ diff --git a/share/sushi/network/hosts/modv6host/preform b/share/sushi/network/hosts/modv6host/preform new file mode 100644 index 000000000000..9578e77bff12 --- /dev/null +++ b/share/sushi/network/hosts/modv6host/preform @@ -0,0 +1,2 @@ +# $NetBSD: preform,v 1.1 2001/04/25 03:43:32 garbled Exp $ +script:script1 Select which host entry to modify diff --git a/share/sushi/network/hosts/modv6host/script b/share/sushi/network/hosts/modv6host/script new file mode 100755 index 000000000000..a42493117c9f --- /dev/null +++ b/share/sushi/network/hosts/modv6host/script @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:32 garbled Exp $ + +IFS=" " +HOSTS=`cat /etc/hosts` +echo $HOSTS | sed -e "s/$4.*/$2 $1 $3/" | >/etc/hosts +if [ "$?" = "0" ]; then + echo "Modified host $1" +else + echo "Failed to modify host $1" +fi diff --git a/share/sushi/network/hosts/modv6host/script1 b/share/sushi/network/hosts/modv6host/script1 new file mode 100755 index 000000000000..2011a878ca0d --- /dev/null +++ b/share/sushi/network/hosts/modv6host/script1 @@ -0,0 +1,4 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:32 garbled Exp $ +grep -v '^#' /etc/hosts | grep -v '^$' | \ + grep -v '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' diff --git a/share/sushi/network/hosts/modv6host/script2 b/share/sushi/network/hosts/modv6host/script2 new file mode 100755 index 000000000000..4206818e8cc9 --- /dev/null +++ b/share/sushi/network/hosts/modv6host/script2 @@ -0,0 +1,6 @@ +#!/bin/sh +# $NetBSD: script2,v 1.1 2001/04/25 03:43:33 garbled Exp $ + +a=`expr $1 + 1` +x=$(echo `eval echo \\$$a`) +echo $x diff --git a/share/sushi/network/index b/share/sushi/network/index new file mode 100644 index 000000000000..c6d483537cf9 --- /dev/null +++ b/share/sushi/network/index @@ -0,0 +1,7 @@ +# $NetBSD: index,v 1.1 2001/04/25 03:43:25 garbled Exp $ +interfaces interfaces Show or configure network adapters +hosts hosts Modify the hosts file +routing routing Show or configure basic routing +hostname hostname Modify this machine's hostname +exports exports Modify NFS exported filesystems +yp yp Setup or Configure NIS/YP diff --git a/share/sushi/network/interfaces/Makefile b/share/sushi/network/interfaces/Makefile new file mode 100644 index 000000000000..f7b4dd9a5b41 --- /dev/null +++ b/share/sushi/network/interfaces/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:33 garbled Exp $ + +SUBDIR= interface listif + +FILES= index help +FILESDIR=${BINDIR}/sushi/network/interfaces +MKOBJ= no + +.include "../../Makefile.inc" +.include +.include diff --git a/share/sushi/network/interfaces/help b/share/sushi/network/interfaces/help new file mode 100644 index 000000000000..b172d201a906 --- /dev/null +++ b/share/sushi/network/interfaces/help @@ -0,0 +1,12 @@ +List all network adapters: +This function will list all the network adapters present on your machine, +and show the status of them, such as the IPV4 address, and the up/down state +of the interface. It will also list some pseudo-drivers, such as ppp or +slip. + +Configure a network adapter: +This form will allow you to configure a network adapter for use. You can set +the IP address, and other options, as well as configure the adapter at +boot-time. + +$NetBSD: help,v 1.1 2001/04/25 03:43:33 garbled Exp $ diff --git a/share/sushi/network/interfaces/index b/share/sushi/network/interfaces/index new file mode 100644 index 000000000000..74dceeb5b998 --- /dev/null +++ b/share/sushi/network/interfaces/index @@ -0,0 +1,3 @@ +# $NetBSD: index,v 1.1 2001/04/25 03:43:33 garbled Exp $ +listif listif List all network adapters +interface interface Configure a network adapter diff --git a/share/sushi/network/interfaces/interface/Makefile b/share/sushi/network/interfaces/interface/Makefile new file mode 100644 index 000000000000..921294447d22 --- /dev/null +++ b/share/sushi/network/interfaces/interface/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:33 garbled Exp $ + +FILES= form help preform +FILESDIR=${BINDIR}/sushi/network/interfaces/interface +SCRIPTS= script script1 script2 +SCRIPTSDIR=${BINDIR}/sushi/network/interfaces/interface +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/interfaces/interface/form b/share/sushi/network/interfaces/interface/form new file mode 100644 index 000000000000..cad424ca7499 --- /dev/null +++ b/share/sushi/network/interfaces/interface/form @@ -0,0 +1,15 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:33 garbled Exp $ +noedit:@@@1@@@ Changing interface: +list:both,now,boot Modify interface at boot-time, now, or both? +req-ipv4script:script2,4,@@@1@@@ Interface IPV4 Address +ipv4script:script2,n,@@@1@@@ Interface IPV4 Netmask +ipv4script:script2,b,@@@1@@@ Interface IPV4 Broadcast Address +script:script2,m,@@@1@@@ Media Type +script:script2,o,@@@1@@@ Media Options +ipv6script:script2,6,@@@1@@@ Interface IPV6 Address +iscript:3,0,128,script2,pre,@@@1@@@ Interface IPV6 Prefix Length(netmask) +escript:32,script2,i,@@@1@@@ Interface Network-ID +#escript:15,script2,k,@@@1@@@ Interface Network-Key +multilist:link0,link1,link2 Interface link options +iscript:5,1,99999,script2,mtu,@@@1@@@ Interface MTU +iscript:2,0,99,script2,met,@@@1@@@ Interface Metric diff --git a/share/sushi/network/interfaces/interface/help b/share/sushi/network/interfaces/interface/help new file mode 100644 index 000000000000..1387c8739548 --- /dev/null +++ b/share/sushi/network/interfaces/interface/help @@ -0,0 +1,7 @@ +You may use this menu to modify an allready configured interface, or +configure a new network interface for your machine. Please consult the +ifconfig(8) manpage for more information on the various options. In most +cases, if you aren't sure what an option does, it should be OK to leave +that option blank, and accept the default. + +$NetBSD: help,v 1.1 2001/04/25 03:43:33 garbled Exp $ diff --git a/share/sushi/network/interfaces/interface/preform b/share/sushi/network/interfaces/interface/preform new file mode 100644 index 000000000000..a5cce55b3d9d --- /dev/null +++ b/share/sushi/network/interfaces/interface/preform @@ -0,0 +1,2 @@ +# $NetBSD: preform,v 1.1 2001/04/25 03:43:33 garbled Exp $ +script:script1 Select an interface to operate on: diff --git a/share/sushi/network/interfaces/interface/script b/share/sushi/network/interfaces/interface/script new file mode 100755 index 000000000000..1f6304f5c301 --- /dev/null +++ b/share/sushi/network/interfaces/interface/script @@ -0,0 +1,108 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:34 garbled Exp $ + +IFFILE="/etc/ifconfig.$1" +MTU=`echo "$12" | sed -e 's/^0*//'` +IFS=" " +ALIASES=`cat /etc/ifconfig.$1 | grep alias` +unset IFS + +if [ "$2" = "boot" -o "$2" = "both" ]; then + echo -n "inet $3" > $IFFILE + if [ ! -z $4 ]; then + echo -n " netmask $4" >> $IFFILE + fi + if [ ! -z $5 ]; then + echo -n " broadcast $5" >> $IFFILE + fi + echo >> $IFFILE + if [ ! -z $6 ]; then + echo -n "media $6" >> $IFFILE + fi + if [ ! -z $7 ]; then + echo -n " mediaopt $7" >> $IFFILE + fi + echo >> $IFFILE + if [ ! -z $8 ]; then + echo -n "inet6 $8" >> $IFFILE + fi + if [ ! -z $9 ]; then + echo -n " prefixlen $9" >> $IFFILE + fi + echo >> $IFFILE + if [ ! -z $10 ]; then + echo -n "nwid $10" >> $IFFILE + fi + if [ ! -z $11 ]; then + LINK=`echo "$11" | sed -e 's/,/ /'` + echo -n " $LINK" >> $IFFILE + fi + ifconfig -m $1 | grep 'Ethernet' >/dev/null + if [ "$?" != "0" -o "$MTU" != "1500" ]; then + if [ ! -z $MTU ]; then + echo -n " mtu $MTU" >> $IFFILE + fi + fi + if [ ! -z $13 -a $13 -ne 0 ]; then + echo -n " metric $13" >> $IFFILE + fi + echo >> $IFFILE + echo "$ALIASES" >> $IFFILE + IFS=" " + IFCON=`cat $IFFILE | sed -e 's/^$//' | sed -e 's/^ *//'` + echo "$IFCON" > $IFFILE + chown root:wheel $IFFILE + chmod 644 $IFFILE + echo "Modifications have been written to $IFFILE" + unset $IFS + echo + echo "$IFCON" +fi + +if [ "$2" = "both" ]; then + (while read args; do + if [ -n "`eval echo '$args'`" ]; then + ifconfig $1 $args + fi + done) < $IFFILE +fi + +if [ "$2" = "now" ]; then + NET=`echo -n "$1 inet $3"` + if [ ! -z $4 ]; then + NET=`echo -n " $NET netmask $4"` + fi + if [ ! -z $5 ]; then + NET=`echo -n " $NET broadcast $5"` + fi + if [ ! -z $6 ]; then + NET=`echo -n " $NET media $6"` + fi + if [ ! -z $7 ]; then + NET=`echo -n " $NET mediaopt $7"` + fi + if [ ! -z $8 ]; then + NET=`echo -n " $NET inet6 $8"` + fi + if [ ! -z $9 ]; then + NET=`echo -n " $NET prefixlen $9"` + fi + if [ ! -z $10 ]; then + NET=`echo -n " $NET nwid $10"` + fi + if [ ! -z $11 ]; then + LINK=`echo "$11" | sed -e 's/,/ /'` + NET=`echo -n " $NET $LINK"` + fi + ifconfig -m $1 | grep 'Ethernet' >/dev/null + if [ "$?" != "0" -o "$MTU" != "1500" ]; then + if [ ! -z $MTU ]; then + NET=`echo -n " $NET mtu $MTU"` + fi + fi + if [ ! -z $13 -a $13 -ne 0 ]; then + NET=`echo -n " $NET metric $13"` + fi + ifconfig $NET + echo "Modifications have been made to $1" +fi diff --git a/share/sushi/network/interfaces/interface/script1 b/share/sushi/network/interfaces/interface/script1 new file mode 100755 index 000000000000..38019e39a6b7 --- /dev/null +++ b/share/sushi/network/interfaces/interface/script1 @@ -0,0 +1,6 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:34 garbled Exp $ +INTFS=`ifconfig -l | sed -e \ + 's/lo.//g;s/sl.//g;s/ppp.//g;s/strip.//g;s/tun.//g;s/ipip.//g;\ + s/eon.//g;s/gre.//g;s/gif.//g'` +echo $INTFS | xargs -n 1 echo diff --git a/share/sushi/network/interfaces/interface/script2 b/share/sushi/network/interfaces/interface/script2 new file mode 100755 index 000000000000..8ad2eebe7a98 --- /dev/null +++ b/share/sushi/network/interfaces/interface/script2 @@ -0,0 +1,157 @@ +#!/bin/sh +# $NetBSD: script2,v 1.1 2001/04/25 03:43:34 garbled Exp $ + +if [ "$1" = "4" ]; then + IPV4=`ifconfig $2 | grep 'inet ' | \ + sed -e 's/inet \([0-9\.]*\) net.*/\1/'` + if [ -z "$IPV4" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + IPV4=`cat /etc/ifconfig.$2 | \ + sed -e 's/[a-zA-z ]*\([0-9\.]*\) .*/\1/'` + else + IPV4=" " + fi + fi + echo $IPV4 + exit 0 +fi +if [ "$1" = "n" ]; then + NETMASK=`ifconfig $2 | grep 'inet ' | \ + sed -e 's/.*netmask \([0-9a-fx\.]*\) broad.*/\1/'` + if [ -z "$NETMASK" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + NETMASK=`cat /etc/ifconfig.$2 | grep netmask | \ + sed -e 's/.*netmask *\([0-9a-fx\.]*\).*/\1/'` + else + NETMASK=" " + fi + fi + echo $NETMASK + exit 0 +fi +if [ "$1" = "b" ]; then + BROAD=`ifconfig $2 | grep 'inet ' | \ + sed -e 's/.*broadcast \([0-9a-fx\.]*\)/\1/'` + if [ -z "$BROAD" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + BROAD=`cat /etc/ifconfig.$2 | grep broadcast | \ + sed -e 's/.*broadcast *\([0-9a-fx\.]*\).*/\1/'` + else + BROAD=" " + fi + fi + echo $BROAD + exit 0 +fi +if [ "$1" = "m" ]; then + MEDIA=`ifconfig $2 | grep 'media: ' | \ + sed -e 's/.*media: Ethernet \([0-9a-zA-z]*\) .*/\1/'` + if [ -z "$MEDIA" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + MEDIA=`cat /etc/ifconfig.$2 | grep media | \ + sed -e 's/.*media *\([0-9a-zA-z]*\) .*/\1/'` + fi + fi + if [ -z $MEDIA ]; then + ifconfig -m $2 | grep 'media ' | awk '{print $2}' | sort | uniq + else + echo $MEDIA + ifconfig -m $2 | grep -v $MEDIA | grep 'media ' | \ + awk '{print $2}' | sort | uniq + fi + exit 0 +fi +if [ "$1" = "o" ]; then + OPT=`ifconfig -m $2 | grep 'media: ' | awk '{print $4}'` + if [ -z "$OPT" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + OPT=`cat /etc/ifconfig.$2 | grep mediaopt | \ + sed -e 's/.*mediaopt *\([a-zA-Z0-9-]*\) *.*/\1/'` + fi + fi + if [ -z "$OPT" ]; then + echo "none" + ifconfig -m $2 | grep 'mediaopt ' | awk '{print $4}' | \ + sort | uniq + else + echo $OPT + ifconfig -m $2 | grep -v $OPT | grep 'mediaopt ' | \ + awk '{print $4}' | sort | uniq + echo "none" + fi + exit 0 +fi +if [ "$1" = "met" ]; then + MET=`ifconfig $2 | grep 'metric ' | sed -e 's/.*metric \([0-9]*\) .*/\1/'` + if [ -z "$MET" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + MET=`cat /etc/ifconfig.$2 | grep metric | \ + sed -e 's/.*metric *\([0-9]*\).*/\1/'` + else + MET="0" + fi + if [ -z "$MET" ]; then + MET="0" + fi + fi + echo $MET + exit 0 +fi +if [ "$1" = "mtu" ]; then + MTU=`ifconfig $2 | grep 'mtu ' | sed -e 's/.*mtu \([0-9]*\)/\1/'` + if [ -z "$MTU" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + MTU=`cat /etc/ifconfig.$2 | grep mtu | \ + sed -e 's/.*mtu *\([0-9]*\).*/\1/'` + else + MTU="1500" + fi + fi + echo $MTU + exit 0 +fi +if [ "$1" = "6" ]; then + IPV6=`ifconfig $2 | grep 'inet6 ' | \ + sed -e 's/inet6 \([0-9:a-z%]*\) pre.*/\1/'` + if [ -z "$IPV6" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + IPV6=`cat /etc/ifconfig.$2 | grep 'inet6 ' | \ + sed -e 's/inet6 \([0-9:a-z%]*\) .*/\1/'` + else + IPV6=" " + fi + fi + echo $IPV6 + exit 0 +fi +if [ "$1" = "pre" ]; then + PRE=`ifconfig $2 | grep 'inet6 ' | sed -e 's/.*prefixlen \([0-9]*\) .*/\1/'` + if [ -z "$PRE" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + PRE=`cat /etc/ifconfig.$2 | grep prefixlen | \ + sed -e 's/.*prefixlen *\([0-9]*\).*/\1/'` + else + PRE="64" + fi + if [ -z "$PRE" ]; then + PRE="64" + fi + fi + echo $PRE + exit 0 +fi +if [ "$1" = "i" ]; then + NWID=`ifconfig $2 | grep 'nwid ' | sed -e 's/.*nwid \([0-9a-zA-Z_]*\)/\1/'` + if [ -z "$NWID" ]; then + if [ -f "/etc/ifconfig.$2" ]; then + NWID=`cat /etc/ifconfig.$2 | grep nwid | \ + sed -e 's/.*nwid *\([0-9a-zA-Z_]*\).*/\1/'` + else + NWID="" + fi + fi + echo $NWID + exit 0 +fi + +echo "" diff --git a/share/sushi/network/interfaces/listif/Makefile b/share/sushi/network/interfaces/listif/Makefile new file mode 100644 index 000000000000..909da7cc1f61 --- /dev/null +++ b/share/sushi/network/interfaces/listif/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:34 garbled Exp $ + +SCRIPTS= script +SCRIPTSDIR=${BINDIR}/sushi/network/interfaces/listif +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/interfaces/listif/script b/share/sushi/network/interfaces/listif/script new file mode 100755 index 000000000000..b45a78e0c869 --- /dev/null +++ b/share/sushi/network/interfaces/listif/script @@ -0,0 +1,23 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:34 garbled Exp $ +INTFS=`ifconfig -l | sed -e \ + 's/lo.//g;s/strip.//g;s/tun.//g;s/ipip.//g;s/eon.//g;s/gre.//g;s/gif.//g'` +echo "Intf# State Media IPV4 Addr. IPV6 Addr." +echo "---------------------------------------------------------------------------" +(for i in $INTFS +do + ifconfig $i | grep UP >/dev/null + if [ "$?" = "0" ]; then + FOO=`echo "$i up"` + else + FOO=`echo "$i down"` + fi + INET=`ifconfig $i | grep 'media:' | awk '{ print $2 }'` + FOO=`echo "$FOO $INET"` + INET=`ifconfig $i | grep 'inet ' | awk '{ print $2 }'` + FOO=`echo "$FOO $INET"` + INET=`ifconfig $i | grep 'inet6' | awk '{ print $2 }'` + FOO=`echo "$FOO $INET"` + + echo $FOO | sed -e 's/ / /g' +done) | sort -rk 2 diff --git a/share/sushi/network/routing/Makefile b/share/sushi/network/routing/Makefile new file mode 100644 index 000000000000..505e1b4eafaa --- /dev/null +++ b/share/sushi/network/routing/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:34 garbled Exp $ + +SUBDIR= default ipv4table + +FILES= index help +FILESDIR=${BINDIR}/sushi/network/routing +MKOBJ= no + +.include "../../Makefile.inc" +.include +.include diff --git a/share/sushi/network/routing/default/Makefile b/share/sushi/network/routing/default/Makefile new file mode 100644 index 000000000000..760239d5627d --- /dev/null +++ b/share/sushi/network/routing/default/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:34 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/routing/default +SCRIPTS= script script1 +SCRIPTSDIR=${BINDIR}/sushi/network/routing/default +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/routing/default/form b/share/sushi/network/routing/default/form new file mode 100644 index 000000000000..ec24265f59b2 --- /dev/null +++ b/share/sushi/network/routing/default/form @@ -0,0 +1,3 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:35 garbled Exp $ +list:both,now,boot Set default route at boot-time, now, or both? +req-escript:40,script1 Default gateway diff --git a/share/sushi/network/routing/default/help b/share/sushi/network/routing/default/help new file mode 100644 index 000000000000..e5defe1fc0b5 --- /dev/null +++ b/share/sushi/network/routing/default/help @@ -0,0 +1,5 @@ +Simply type the hostname or IP address of the default gateway for this +machine, and hit enter. If the default gateway is specified as a hostname, +rather than by IP, that hostname must exist in /etc/hosts. + +$NetBSD: help,v 1.1 2001/04/25 03:43:35 garbled Exp $ diff --git a/share/sushi/network/routing/default/script b/share/sushi/network/routing/default/script new file mode 100755 index 000000000000..f0b0262e3e79 --- /dev/null +++ b/share/sushi/network/routing/default/script @@ -0,0 +1,15 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:35 garbled Exp $ + +if [ "$1" = "both" -o "$1" = "boot" ]; then + echo "$2" >/etc/mygate +fi +if [ "$1" = "both" -o "$1" = "now" ]; then + route delete default + route add default $2 +fi +if [ "$?" = "0" ]; then + echo "Default route has been changed to $2" +else + echo "Failed to change default route to $2" +fi diff --git a/share/sushi/network/routing/default/script1 b/share/sushi/network/routing/default/script1 new file mode 100755 index 000000000000..0f6ac774b7a5 --- /dev/null +++ b/share/sushi/network/routing/default/script1 @@ -0,0 +1,11 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:35 garbled Exp $ + +if [ -f "/etc/mygate" ]; then + cat /etc/mygate +else + netstat -rnf inet | grep default | awk '{ print $2 }' +fi +if [ "$?" = "1" ]; then + echo +fi diff --git a/share/sushi/network/routing/help b/share/sushi/network/routing/help new file mode 100644 index 000000000000..bda9b709ce97 --- /dev/null +++ b/share/sushi/network/routing/help @@ -0,0 +1,5 @@ +Display the IPV4 routing table: +This function displays the current IPV4 routing table. + +Modify the IPV4 default route: +This form allows you to change your default route. diff --git a/share/sushi/network/routing/index b/share/sushi/network/routing/index new file mode 100644 index 000000000000..fa89f94b2431 --- /dev/null +++ b/share/sushi/network/routing/index @@ -0,0 +1,3 @@ +# $NetBSD: index,v 1.1 2001/04/25 03:43:34 garbled Exp $ +ipv4table ipv4table Display the IPV4 routing table +default defroute Modify the IPV4 default route diff --git a/share/sushi/network/routing/ipv4table/Makefile b/share/sushi/network/routing/ipv4table/Makefile new file mode 100644 index 000000000000..696882fe2d35 --- /dev/null +++ b/share/sushi/network/routing/ipv4table/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:35 garbled Exp $ + +SCRIPTS= exec +SCRIPTSDIR=${BINDIR}/sushi/network/routing/ipv4table +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/routing/ipv4table/exec b/share/sushi/network/routing/ipv4table/exec new file mode 100644 index 000000000000..18575b9697ec --- /dev/null +++ b/share/sushi/network/routing/ipv4table/exec @@ -0,0 +1 @@ +netstat -rnf inet diff --git a/share/sushi/network/yp/Makefile b/share/sushi/network/yp/Makefile new file mode 100644 index 000000000000..61c31c9e0f92 --- /dev/null +++ b/share/sushi/network/yp/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:35 garbled Exp $ + +SUBDIR= client domainname master slave + +FILES= index help +FILESDIR=${BINDIR}/sushi/network/yp +MKOBJ= no + +.include "../../Makefile.inc" +.include +.include diff --git a/share/sushi/network/yp/client/Makefile b/share/sushi/network/yp/client/Makefile new file mode 100644 index 000000000000..57dbcbc11fff --- /dev/null +++ b/share/sushi/network/yp/client/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:36 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/yp/client +SCRIPTS= script script1 +SCRIPTSDIR=${BINDIR}/sushi/network/yp/client +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/yp/client/form b/share/sushi/network/yp/client/form new file mode 100644 index 000000000000..a87220b346c6 --- /dev/null +++ b/share/sushi/network/yp/client/form @@ -0,0 +1,2 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:36 garbled Exp $ +escript:40,script1 Domainname of YP/NIS server diff --git a/share/sushi/network/yp/client/help b/share/sushi/network/yp/client/help new file mode 100644 index 000000000000..af09ea59f9c5 --- /dev/null +++ b/share/sushi/network/yp/client/help @@ -0,0 +1,5 @@ +This form will initialize your machine as a NIS client. See the ypinit(8) +manpage for more details. The domainname is the NIS domain you wish to +bind to. + +$NetBSD: help,v 1.1 2001/04/25 03:43:36 garbled Exp $ diff --git a/share/sushi/network/yp/client/script b/share/sushi/network/yp/client/script new file mode 100755 index 000000000000..c64463678de7 --- /dev/null +++ b/share/sushi/network/yp/client/script @@ -0,0 +1,13 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:36 garbled Exp $ + +if [ -z "$1" ]; then + ypinit -c +else + ypinit -c $1 +fi +if [ "$?" = "0" ]; then + echo "YP/NIS Client initialization complete" +else + echo "YP/NIS Client initialization failed" +fi diff --git a/share/sushi/network/yp/client/script1 b/share/sushi/network/yp/client/script1 new file mode 100755 index 000000000000..334984d0d97c --- /dev/null +++ b/share/sushi/network/yp/client/script1 @@ -0,0 +1,8 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:36 garbled Exp $ + +if [ -f "/etc/myname" ]; then + cat /etc/defaultdomain +else + domainname +fi diff --git a/share/sushi/network/yp/domainname/Makefile b/share/sushi/network/yp/domainname/Makefile new file mode 100644 index 000000000000..ca5e1a09dcf3 --- /dev/null +++ b/share/sushi/network/yp/domainname/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:36 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/yp/domainname +SCRIPTS= script script1 +SCRIPTSDIR=${BINDIR}/sushi/network/yp/domainname +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/yp/domainname/form b/share/sushi/network/yp/domainname/form new file mode 100644 index 000000000000..c2fc973de6d5 --- /dev/null +++ b/share/sushi/network/yp/domainname/form @@ -0,0 +1,3 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:36 garbled Exp $ +escript:40,script1 Domainname of this machine +list:both,now,boot Modify domainname now, at boot-time, or both? diff --git a/share/sushi/network/yp/domainname/help b/share/sushi/network/yp/domainname/help new file mode 100644 index 000000000000..3f5b0626ccb5 --- /dev/null +++ b/share/sushi/network/yp/domainname/help @@ -0,0 +1,6 @@ +After setting the NIS domainname of this machine, choose where you want +to make the modification. Setting it at boot-time only will require a reboot +to take effect. By setting the domainname now, it will not be preserved on +the next boot. + +$NetBSD: help,v 1.1 2001/04/25 03:43:36 garbled Exp $ diff --git a/share/sushi/network/yp/domainname/script b/share/sushi/network/yp/domainname/script new file mode 100755 index 000000000000..8fd31fec30f8 --- /dev/null +++ b/share/sushi/network/yp/domainname/script @@ -0,0 +1,14 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:37 garbled Exp $ + +if [ "$2" = "both" -o "$2" = "boot" ]; then + echo "$1" >/etc/defaultdomain +fi +if [ "$2" = "both" -o "$2" = "now" ]; then + domainname $1 +fi +if [ "$?" = "0" ]; then + echo "Domainname has been changed to $1" +else + echo "Failed to change domainname to $1" +fi diff --git a/share/sushi/network/yp/domainname/script1 b/share/sushi/network/yp/domainname/script1 new file mode 100755 index 000000000000..fa8085849d09 --- /dev/null +++ b/share/sushi/network/yp/domainname/script1 @@ -0,0 +1,8 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:37 garbled Exp $ + +if [ -f "/etc/myname" ]; then + cat /etc/defaultdomain +else + domainname +fi diff --git a/share/sushi/network/yp/help b/share/sushi/network/yp/help new file mode 100644 index 000000000000..55668e3ab342 --- /dev/null +++ b/share/sushi/network/yp/help @@ -0,0 +1,11 @@ +Modify the domainname: +Modify or set this machine's NIS domainname. + +You may also: +Initialize this machine as a YP/NIS client +Initialize this machine as a YP/NIS slave +Initialize this machine as a YP/NIS master + +by using the functions provided. + +$NetBSD: help,v 1.1 2001/04/25 03:43:36 garbled Exp $ diff --git a/share/sushi/network/yp/index b/share/sushi/network/yp/index new file mode 100644 index 000000000000..463048f622e6 --- /dev/null +++ b/share/sushi/network/yp/index @@ -0,0 +1,6 @@ +# $NetBSD: index,v 1.1 2001/04/25 03:43:36 garbled Exp $ +domainname domainname Modify the domainname +client ypclient Initialize this machine as a YP/NIS client +slave yslave Initialize this machine as a YP/NIS slave +master ypmaster Initialize this machine as a YP/NIS master + diff --git a/share/sushi/network/yp/master/Makefile b/share/sushi/network/yp/master/Makefile new file mode 100644 index 000000000000..6d093cef9ca6 --- /dev/null +++ b/share/sushi/network/yp/master/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:37 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/yp/master +SCRIPTS= script script1 +SCRIPTSDIR=${BINDIR}/sushi/network/yp/master +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/yp/master/form b/share/sushi/network/yp/master/form new file mode 100644 index 000000000000..e9285d0e4845 --- /dev/null +++ b/share/sushi/network/yp/master/form @@ -0,0 +1,2 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:37 garbled Exp $ +escript:40,script1 Domainname of YP/NIS server diff --git a/share/sushi/network/yp/master/help b/share/sushi/network/yp/master/help new file mode 100644 index 000000000000..6030a4150382 --- /dev/null +++ b/share/sushi/network/yp/master/help @@ -0,0 +1,5 @@ +This form will initialize your machine as a NIS master. See the ypinit(8) +manpage for more details. The domainname is the NIS domain you wish to +bind to. + +$NetBSD: help,v 1.1 2001/04/25 03:43:37 garbled Exp $ diff --git a/share/sushi/network/yp/master/script b/share/sushi/network/yp/master/script new file mode 100755 index 000000000000..4963a60c9baa --- /dev/null +++ b/share/sushi/network/yp/master/script @@ -0,0 +1,13 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:37 garbled Exp $ + +if [ -z "$1" ]; then + ypinit -m +else + ypinit -m $1 +fi +if [ "$?" = "0" ]; then + echo "YP/NIS Master initialization complete" +else + echo "YP/NIS Master initialization failed" +fi diff --git a/share/sushi/network/yp/master/script1 b/share/sushi/network/yp/master/script1 new file mode 100755 index 000000000000..fa8085849d09 --- /dev/null +++ b/share/sushi/network/yp/master/script1 @@ -0,0 +1,8 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:37 garbled Exp $ + +if [ -f "/etc/myname" ]; then + cat /etc/defaultdomain +else + domainname +fi diff --git a/share/sushi/network/yp/slave/Makefile b/share/sushi/network/yp/slave/Makefile new file mode 100644 index 000000000000..8186706ec0d3 --- /dev/null +++ b/share/sushi/network/yp/slave/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2001/04/25 03:43:37 garbled Exp $ + +FILES= form help +FILESDIR=${BINDIR}/sushi/network/yp/slave +SCRIPTS= script script1 +SCRIPTSDIR=${BINDIR}/sushi/network/yp/slave +MKOBJ= no + +.include "../../../Makefile.inc" +.include diff --git a/share/sushi/network/yp/slave/form b/share/sushi/network/yp/slave/form new file mode 100644 index 000000000000..e1dd4192c4a5 --- /dev/null +++ b/share/sushi/network/yp/slave/form @@ -0,0 +1,3 @@ +# $NetBSD: form,v 1.1 2001/04/25 03:43:38 garbled Exp $ +req-entry:40 Hostname of master YP/NIS server +escript:40,script1 Domainname of YP/NIS server diff --git a/share/sushi/network/yp/slave/help b/share/sushi/network/yp/slave/help new file mode 100644 index 000000000000..4ea93e5213e3 --- /dev/null +++ b/share/sushi/network/yp/slave/help @@ -0,0 +1,5 @@ +This form will initialize your machine as a NIS slave. See the ypinit(8) +manpage for more details. The domainname is the NIS domain you wish to +bind to. + +$NetBSD: help,v 1.1 2001/04/25 03:43:38 garbled Exp $ diff --git a/share/sushi/network/yp/slave/script b/share/sushi/network/yp/slave/script new file mode 100755 index 000000000000..3ea6e2ba822c --- /dev/null +++ b/share/sushi/network/yp/slave/script @@ -0,0 +1,13 @@ +#!/bin/sh +# $NetBSD: script,v 1.1 2001/04/25 03:43:38 garbled Exp $ + +if [ -z "$2" ]; then + ypinit -s $1 +else + ypinit -s $1 $2 +fi +if [ "$?" = "0" ]; then + echo "YP/NIS Slave initialization complete" +else + echo "YP/NIS Slave initialization failed" +fi diff --git a/share/sushi/network/yp/slave/script1 b/share/sushi/network/yp/slave/script1 new file mode 100755 index 000000000000..c0573a2fe574 --- /dev/null +++ b/share/sushi/network/yp/slave/script1 @@ -0,0 +1,8 @@ +#!/bin/sh +# $NetBSD: script1,v 1.1 2001/04/25 03:43:38 garbled Exp $ + +if [ -f "/etc/myname" ]; then + cat /etc/defaultdomain +else + domainname +fi