Add entry to sushi for managing your /etc/inetd.conf file

This commit is contained in:
garbled 2001-03-06 21:18:42 +00:00
parent ec910948f9
commit ec637bec44
4 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/03/06 21:18:42 garbled Exp $
FILES= form
FILESDIR=${BINDIR}/sushi/system/inetdconf
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/system/inetdconf
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,48 @@
# $NetBSD: form,v 1.1 2001/03/06 21:18:42 garbled Exp $
script:script1,ftp,tcp Ftp service
script:script1,telnet,tcp Telnet service
script:script1,shell,tcp Rshd/shell service
script:script1,login,tcp Rlogind/login service
script:script1,exec,tcp Rexecd/exec service
script:script1,uucpd,tcp Uucpd service
script:script1,nntp,tcp Nntp service
script:script1,finger,tcp Finger service
script:script1,ident,tcp Ident service
script:script1,tftp,udp Tftp service
script:script1,comsat,udp Comsat/biff service
script:script1,ntalk,udp Ntalk service
script:script1,bootps,udp Bootpd service
script:script1,hunt,udp Hunt service
script:script1,tcpmux,tcp Tcpmux service
script:script1,echo,tcp Echo TCP service
script:script1,discard,tcp Discard TCP service
script:script1,chargen,tcp Chargen TCP service
script:script1,daytime,tcp Daytime TCP service
script:script1,time,tcp Time TCP service
script:script1,echo,udp Echo UDP service
script:script1,discard,udp Discard UDP service
script:script1,chargen,udp Chargen UDP service
script:script1,daytime,udp Daytime UDP service
script:script1,time,udp Time UDP service
script:script1,qotd,tcp QOTD/Fortune service
script:script1,klogin,tcp Kerberized rlogin service
script:script1,eklogin,tcp Encrypted Kerberized rlogin service
script:script1,kshell,tcp Kerberized rsh/shell service
script:script1,kerberos-adm,tcp Kadmind service
script:script1,kpasswd,udp Kpasswdd service
script:script1,hprop,tcp Kerberos DB propogation service
script:script1,rstatd/1-3,rpc/udp Rstatd RPC service
script:script1,rusersd/2-3,rpc/udp Rusers RPC service
script:script1,walld/1,rpc/udp Rwalld RPC service
script:script1,sprayd/1,rpc/udp Sprayd RPC service
script:script1,rquotad/1,rpc/udp Rquotad RPC service
script:script1,ftp,tcp6 Ftp IPV6 service
script:script1,telnet,tcp6 Telnet IPV6 service
script:script1,shell,tcp6 Rshd/shell IPV6 service
script:script1,login,tcp6 Rlogin/login IPV6 service
script:script1,finger,tcp6 Finger IPV6 service
script:script1,tftp,udp6 TFTP IPV6 service
script:script1,kpasswd,udp6 Kpaswwdd IPV6 service
script:script1,rstatd/1-3,rpc/udp6 Rstatd IPV6 RPC service
script:script1,rusersd/2-3,rpc/udp6 Rusersd IPV6 RPC service

View File

@ -0,0 +1,49 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/03/06 21:18:42 garbled Exp $
BIGLIST="ftp,tcp telnet,tcp shell,tcp login,tcp exec,tcp uucpd,tcp nntp,tcp \
finger,tcp ident,tcp tftp,udp comsat,udp ntalk,udp bootps,udp hunt,udp \
tcpmux,tcp echo,tcp discard,tcp chargen,tcp daytime,tcp time,tcp echo,udp \
discard,udp chargen,udp daytime,udp time,udp qotd,tcp klogin,tcp eklogin,tcp \
kshell,tcp kerberos-adm,tcp kpasswd,udp hprop,tcp rstatd/1-3,rpc/udp \
rusersd/2-3,rpc/udp walld/1,rpc/udp sprayd/1,rpc/udp rquotad/1,rpc/udp \
ftp,tcp6 telnet,tcp6 shell,tcp6 login,tcp6 finger,tcp6 tftp,udp6 \
kpasswd,udp6 rstatd/1-3,rpc/udp6 rusersd/2-3,rpc/udp6"
INETDCONF="/etc/inetd.conf"
IFS=" "
CONF=`cat $INETDCONF`
echo "Processing $INETDCONF"
j=0
for i in $BIGLIST
do
TCONF="${CONF}"
j=`expr $j + 1`
x=$(echo `eval echo \\$${j}`)
A=`echo "$i" | sed -e 's@,@ .* @'`
B=`echo "$i" | sed -e 's@,@ @'`
C=`/usr/share/sushi/system/inetdconf/script1 $B | grep YES`
if [ -z "$C" -a $x = "YES" ]; then
echo "Cannot enable service $B"
continue
fi
C=`/usr/share/sushi/system/inetdconf/script1 $B | head -1`
if [ $C = "YES" -a $x = "YES" ]; then
continue
fi
if [ $C = "NO" -a $x = "NO" ]; then
continue
fi
if [ $C = "YES" -a $x = "NO" ]; then
echo "DISABLING service $B"
CONF=`echo $TCONF | sed -e "s@\(^$A .*\)@#\1@"`
fi
if [ $C = "NO" -a $x = "YES" ]; then
echo "ENABLING service $B"
CONF=`echo $TCONF | sed -e "s@^#\($A .*\)@\1@"`
fi
done
echo "Writing modified version to $INETDCONF"
echo $CONF >$INETDCONF

View File

@ -0,0 +1,18 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/03/06 21:18:42 garbled Exp $
A=`grep "^#$1 .* $2 " /etc/inetd.conf`
if [ "$A" ]; then
echo "NO"
echo "YES"
exit 0
fi
A=`grep "^$1 .* $2 " /etc/inetd.conf`
if [ "$A" ]; then
echo "YES"
echo "NO"
exit 0
fi
echo "NO"