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.
This commit is contained in:
parent
5de93d4755
commit
9b603a2514
|
@ -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)
|
||||
|
|
|
@ -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 <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
|
@ -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 <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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?
|
|
@ -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 $
|
|
@ -0,0 +1,2 @@
|
|||
# $NetBSD: preform,v 1.1 2001/04/25 03:43:26 garbled Exp $
|
||||
script:script1 Filesystem to export
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
cut -f 1 -d : /etc/group
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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?
|
|
@ -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 $
|
|
@ -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
|
||||
|
|
@ -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}'
|
|
@ -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 $
|
|
@ -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
|
|
@ -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 $
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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?
|
|
@ -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 $
|
|
@ -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
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
|
@ -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 <bsd.prog.mk>
|
|
@ -0,0 +1,3 @@
|
|||
req-entry:40 Hostname
|
||||
req-ipv4: IPV4 address
|
||||
entry:40 Optional Aliases (space separated)
|
|
@ -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 $
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
|
@ -0,0 +1,3 @@
|
|||
req-entry:40 Hostname
|
||||
req-ipv6: IPV6 address
|
||||
entry:40 Optional Aliases (space separated)
|
|
@ -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 $
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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
|
|
@ -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 $
|
|
@ -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
|
|
@ -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 '^$'
|
|
@ -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 $
|
|
@ -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
|
||||
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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@@@
|
|
@ -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 $
|
|
@ -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
|
|
@ -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
|
|
@ -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\}'
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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@@@
|
|
@ -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 $
|
|
@ -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
|
|
@ -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
|
|
@ -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\}'
|
|
@ -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
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
|
@ -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 $
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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
|
|
@ -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 $
|
|
@ -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:
|
|
@ -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
|
|
@ -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
|
|
@ -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 ""
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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
|
|
@ -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 $
|
|
@ -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
|
|
@ -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
|
|
@ -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.
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
|
@ -0,0 +1 @@
|
|||
netstat -rnf inet
|
|
@ -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 <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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
|
|
@ -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 $
|
|
@ -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
|
|
@ -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
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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?
|
|
@ -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 $
|
|
@ -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
|
|
@ -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
|
|
@ -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 $
|
|
@ -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
|
||||
|
|
@ -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 <bsd.prog.mk>
|
|
@ -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
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue