From b7d872536535fe8afd8ad5080a504fa41a77c095 Mon Sep 17 00:00:00 2001 From: schweikh Date: Sat, 12 Oct 2002 10:31:31 +0000 Subject: Fix style bugs: * Space -> tabs conversion. * Removed blanks before semicolon in "if ... ; then". * Proper indentation of misindented lines. * Put a full stop after some comments. * Removed whitespace at end of line. Approved by: silence from gordon --- etc/network.subr | 80 ++++++++++++++++++++++++------------------------ etc/rc.d/accounting | 2 +- etc/rc.d/addswap | 2 +- etc/rc.d/amd | 6 ++-- etc/rc.d/apmd | 8 ++--- etc/rc.d/archdep | 8 ++--- etc/rc.d/atm2 | 2 +- etc/rc.d/atm2.sh | 2 +- etc/rc.d/bootconf.sh | 6 ++-- etc/rc.d/cleanvar | 2 +- etc/rc.d/cleartmp | 2 +- etc/rc.d/devdb | 6 ++-- etc/rc.d/diskless | 6 ++-- etc/rc.d/fsck | 2 +- etc/rc.d/initdiskless | 26 ++++++++-------- etc/rc.d/ip6fw | 2 +- etc/rc.d/ipfilter | 6 ++-- etc/rc.d/ipfw | 8 ++--- etc/rc.d/ipmon | 8 ++--- etc/rc.d/ipnat | 4 +-- etc/rc.d/isdnd | 2 +- etc/rc.d/mountcritremote | 6 ++-- etc/rc.d/mountd | 6 ++-- etc/rc.d/named | 22 ++++++------- etc/rc.d/netoptions | 6 ++-- etc/rc.d/network1 | 80 ++++++++++++++++++++++++------------------------ etc/rc.d/network3 | 6 ++-- etc/rc.d/network_ipv6 | 22 ++++++------- etc/rc.d/nfsclient | 4 +-- etc/rc.d/nfsd | 2 +- etc/rc.d/nfsserver | 4 +-- etc/rc.d/ntpd | 2 +- etc/rc.d/ntpdate | 4 +-- etc/rc.d/pccard | 4 +-- etc/rc.d/pcvt | 7 ++--- etc/rc.d/ppp | 6 ++-- etc/rc.d/ppp-user | 6 ++-- etc/rc.d/quota | 2 +- etc/rc.d/random | 4 +-- etc/rc.d/resolv | 6 ++-- etc/rc.d/root | 2 +- etc/rc.d/rtadvd | 28 ++++++++--------- etc/rc.d/sendmail | 2 +- etc/rc.d/serial | 2 +- etc/rc.d/tmp | 6 ++-- etc/rc.d/var | 6 ++-- etc/rc.d/wscons | 18 +++++------ etc/rc.d/ypserv | 4 +-- etc/rc.d/ypset | 10 +++--- etc/rc.d/ypupdated | 10 +++--- etc/rc.d/ypxfrd | 10 +++--- etc/rc.initdiskless | 26 ++++++++-------- 52 files changed, 256 insertions(+), 257 deletions(-) diff --git a/etc/network.subr b/etc/network.subr index ae00cfd..4887042 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -15,50 +15,50 @@ stop_cmd="network_stop" convert_host_conf() { - host_conf=$1; shift; - nsswitch_conf=$1; shift; - awk ' \ - /^[:blank:]*#/ { next } \ - /(hosts|local|file)/ { nsswitch[c] = "files"; c++; next } \ - /(dns|bind)/ { nsswitch[c] = "dns"; c++; next } \ - /nis/ { nsswitch[c] = "nis"; c++; next } \ - { printf "Warning: unrecognized line [%s]", $0 > "/dev/stderr" } \ - END { \ - printf "hosts: "; \ - for (i in nsswitch) printf "%s ", nsswitch[i]; \ - printf "\n"; \ - }' < $host_conf > $nsswitch_conf + host_conf=$1; shift; + nsswitch_conf=$1; shift; + awk ' \ + /^[:blank:]*#/ { next } \ + /(hosts|local|file)/ { nsswitch[c] = "files"; c++; next } \ + /(dns|bind)/ { nsswitch[c] = "dns"; c++; next } \ + /nis/ { nsswitch[c] = "nis"; c++; next } \ + { printf "Warning: unrecognized line [%s]", $0 > "/dev/stderr" } \ + END { \ + printf "hosts: "; \ + for (i in nsswitch) printf "%s ", nsswitch[i]; \ + printf "\n"; \ + }' < $host_conf > $nsswitch_conf } generate_host_conf() { - nsswitch_conf=$1; shift; - host_conf=$1; shift; - - awk ' -BEGIN { - xlat["files"] = "hosts"; - xlat["dns"] = "bind"; - xlat["nis"] = "nis"; - cont = 0; -} -sub(/^[\t ]*hosts:/, "") || cont { - if (!cont) - srcs = "" - sub(/#.*/, "") - gsub(/[][]/, " & ") - cont = sub(/\\$/, "") - srcs = srcs " " $0 -} -END { - print "# Auto-generated from nsswitch.conf, do not edit" - ns = split(srcs, s) - for (n = 1; n <= ns; ++n) { - if (s[n] in xlat) - print xlat[s[n]] - } -} -' <$nsswitch_conf >$host_conf + nsswitch_conf=$1; shift; + host_conf=$1; shift; + + awk ' + BEGIN { + xlat["files"] = "hosts"; + xlat["dns"] = "bind"; + xlat["nis"] = "nis"; + cont = 0; + } + sub(/^[\t ]*hosts:/, "") || cont { + if (!cont) + srcs = "" + sub(/#.*/, "") + gsub(/[][]/, " & ") + cont = sub(/\\$/, "") + srcs = srcs " " $0 + } + END { + print "# Auto-generated from nsswitch.conf, do not edit" + ns = split(srcs, s) + for (n = 1; n <= ns; ++n) { + if (s[n] in xlat) + print xlat[s[n]] + } + } + ' <$nsswitch_conf >$host_conf } network_gif_setup() { diff --git a/etc/rc.d/accounting b/etc/rc.d/accounting index 6b7ecf0..a24cc07 100755 --- a/etc/rc.d/accounting +++ b/etc/rc.d/accounting @@ -24,7 +24,7 @@ accounting_start() FreeBSD) _dir=`dirname "$accounting_file"` if [ ! -d `dirname "$_dir"` ]; then - if ! mkdir -p "$_dir" ; then + if ! mkdir -p "$_dir"; then warn "Could not create $_dir." return 1 fi diff --git a/etc/rc.d/addswap b/etc/rc.d/addswap index 12233d7..e2ddccd 100644 --- a/etc/rc.d/addswap +++ b/etc/rc.d/addswap @@ -24,7 +24,7 @@ addswap_start() *) if [ -w "${swapfile}" -a -c /dev/mdctl ]; then echo "Adding ${swapfile} as additional swap" - mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev} + mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev} fi ;; esac diff --git a/etc/rc.d/amd b/etc/rc.d/amd index 10b38c4..0423624 100755 --- a/etc/rc.d/amd +++ b/etc/rc.d/amd @@ -28,17 +28,17 @@ NetBSD) ;; esac -amd_precmd() +amd_precmd() { case ${OSTYPE} in FreeBSD) - if ! checkyesno nfs_client_enable ; then + if ! checkyesno nfs_client_enable; then force_depend nfsclient || return 1 fi if ! checkyesno rpcbind_enable && \ ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then + then force_depend rpcbind || return 1 fi diff --git a/etc/rc.d/apmd b/etc/rc.d/apmd index d4a9835..8cf548e 100755 --- a/etc/rc.d/apmd +++ b/etc/rc.d/apmd @@ -23,15 +23,15 @@ esac apmd_prestart() { - case `${SYSCTL_N} hw.machine_arch` in - i386) + case `${SYSCTL_N} hw.machine_arch` in + i386) # Don't start if apm is already running /etc/rc.d/apm forcestatus > /dev/null && return 1 - ;; + ;; *) return 1 ;; - esac + esac return 0 } diff --git a/etc/rc.d/archdep b/etc/rc.d/archdep index 28bf7bc..2935283 100644 --- a/etc/rc.d/archdep +++ b/etc/rc.d/archdep @@ -17,7 +17,7 @@ load_rc_config $name # unaligned_warnings() { - if ! checkyesno unaligned_print ; then + if ! checkyesno unaligned_print; then sysctl machdep.unaligned_print=0 fi } @@ -26,7 +26,7 @@ unaligned_warnings() # osf1_compat() { - if checkyesno osf1_enable ; then + if checkyesno osf1_enable; then echo -n ' OSF/1' if ! kldstat -v | grep osf1_ecoff > /dev/null; then kldload osf1 > /dev/null 2>&1 @@ -38,7 +38,7 @@ osf1_compat() # ibcs2_compat() { - if checkyesno ibcs2_enable ; then + if checkyesno ibcs2_enable; then echo -n ' ibcs2' kldload ibcs2 > /dev/null 2>&1 case ${ibcs2_loaders} in @@ -57,7 +57,7 @@ ibcs2_compat() # x10_daemon() { - if checkyesno xtend_enable ; then + if checkyesno xtend_enable; then echo -n ' xtend' /usr/libexec/xtend fi diff --git a/etc/rc.d/atm2 b/etc/rc.d/atm2 index 8854605..762c77c 100644 --- a/etc/rc.d/atm2 +++ b/etc/rc.d/atm2 @@ -90,7 +90,7 @@ atm2_start() # XXX - required by atm3.sh. I don't like having one script depend # on variables in another script (especially in a dynamic # ordered system like this), but it's necessary for the moment. - # + # export atm_atmarpd export atm_scspd } diff --git a/etc/rc.d/atm2.sh b/etc/rc.d/atm2.sh index 8854605..762c77c 100644 --- a/etc/rc.d/atm2.sh +++ b/etc/rc.d/atm2.sh @@ -90,7 +90,7 @@ atm2_start() # XXX - required by atm3.sh. I don't like having one script depend # on variables in another script (especially in a dynamic # ordered system like this), but it's necessary for the moment. - # + # export atm_atmarpd export atm_scspd } diff --git a/etc/rc.d/bootconf.sh b/etc/rc.d/bootconf.sh index aa2dc1b..24803bc 100755 --- a/etc/rc.d/bootconf.sh +++ b/etc/rc.d/bootconf.sh @@ -32,7 +32,7 @@ bootconf_start() case $name in current|default|\*) continue - ;; + ;; *) if [ "$name" = "$default" ]; then echo -n "${spc}[${name}]" @@ -53,7 +53,7 @@ bootconf_start() (sleep 30 && kill -ALRM $master) >/dev/null 2>&1 & read conf trap : ALRM - if [ -z $conf ] ; then + if [ -z $conf ]; then conf=$default fi if [ ! -d /etc/etc.$conf/. ]; then @@ -70,7 +70,7 @@ bootconf_start() ;; esac - if [ -f /etc/rc.conf ] ; then + if [ -f /etc/rc.conf ]; then . /etc/rc.conf fi } diff --git a/etc/rc.d/cleanvar b/etc/rc.d/cleanvar index 5e7331a..e67b24e 100644 --- a/etc/rc.d/cleanvar +++ b/etc/rc.d/cleanvar @@ -10,7 +10,7 @@ purgedir() { - local dir file + local dir file if [ $# -eq 0 ]; then purgedir . diff --git a/etc/rc.d/cleartmp b/etc/rc.d/cleartmp index eb3135f..e786824 100755 --- a/etc/rc.d/cleartmp +++ b/etc/rc.d/cleartmp @@ -27,7 +27,7 @@ cleartmp_start() (cd /tmp && rm -rf [a-km-pr-zA-Z]* && find -x . ! -name . ! -name lost+found ! -name quota.user \ ! -name quota.group -exec rm -rf -- {} \; -type d -prune) - + case ${OSTYPE} in FreeBSD) # Remove X lock files, since they will prevent you from diff --git a/etc/rc.d/devdb b/etc/rc.d/devdb index 8bd040a..57edafb 100644 --- a/etc/rc.d/devdb +++ b/etc/rc.d/devdb @@ -9,9 +9,9 @@ # Build device name databases if we are not using DEVFS # -if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then - rm -f /var/run/dev.db +if sysctl vfs.devfs.generation > /dev/null 2>&1; then + rm -f /var/run/dev.db else - dev_mkdb + dev_mkdb fi diff --git a/etc/rc.d/diskless b/etc/rc.d/diskless index cef6e8a..647e3b7 100644 --- a/etc/rc.d/diskless +++ b/etc/rc.d/diskless @@ -55,8 +55,8 @@ mount_md() # If there is a global system configuration file, suck it in. # if [ -r /etc/rc.subr ]; then - . /etc/rc.subr - load_rc_config $name + . /etc/rc.subr + load_rc_config $name elif [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs @@ -108,7 +108,7 @@ if [ ! -L /tmp ]; then chmod 01777 /tmp fi -if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then +if sysctl vfs.devfs.generation > /dev/null 2>&1; then # we have DEVFS, no worries... true else diff --git a/etc/rc.d/fsck b/etc/rc.d/fsck index 1a33532..331d233 100755 --- a/etc/rc.d/fsck +++ b/etc/rc.d/fsck @@ -83,7 +83,7 @@ fsck_start() stop_boot ;; esac - ;; + ;; 12) echo "Boot interrupted." stop_boot diff --git a/etc/rc.d/initdiskless b/etc/rc.d/initdiskless index 6722365..faa2acb 100644 --- a/etc/rc.d/initdiskless +++ b/etc/rc.d/initdiskless @@ -81,19 +81,19 @@ bootp_ipa="" bootp_ipbca="" iflist=`ifconfig -l` for i in ${iflist} ; do - set `ifconfig ${i}` - while [ $# -ge 1 ] ; do - if [ "${bootp_ifc}" = "" -a "$1" = "inet" ] ; then - bootp_ifc=${i} ; bootp_ipa=${2} ; shift - fi - if [ "${bootp_ipbca}" = "" -a "$1" = "broadcast" ] ; then - bootp_ipbca=$2; shift - fi - shift - done - if [ "${bootp_ifc}" != "" ] ; then - break - fi + set `ifconfig ${i}` + while [ $# -ge 1 ] ; do + if [ "${bootp_ifc}" = "" -a "$1" = "inet" ]; then + bootp_ifc=${i} ; bootp_ipa=${2} ; shift + fi + if [ "${bootp_ipbca}" = "" -a "$1" = "broadcast" ]; then + bootp_ipbca=$2; shift + fi + shift + done + if [ "${bootp_ifc}" != "" ]; then + break + fi done echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" diff --git a/etc/rc.d/ip6fw b/etc/rc.d/ip6fw index 4f37e26..e0726bf 100644 --- a/etc/rc.d/ip6fw +++ b/etc/rc.d/ip6fw @@ -48,7 +48,7 @@ ip6fw_start() # Enable firewall logging # - if checkyesno ipv6_firewall_logging ; then + if checkyesno ipv6_firewall_logging; then echo 'IPv6 Firewall logging=YES' sysctl net.inet6.ip6.fw.verbose=1 >/dev/null fi diff --git a/etc/rc.d/ipfilter b/etc/rc.d/ipfilter index 964668b..2ee2d28 100755 --- a/etc/rc.d/ipfilter +++ b/etc/rc.d/ipfilter @@ -40,7 +40,7 @@ case ${OSTYPE} in FreeBSD) # load ipfilter kernel module if needed if ! sysctl net.inet.ipf.fr_pass > /dev/null 2>&1; then - if kldload ipl ; then + if kldload ipl; then echo 'IP-filter module loaded.' else warn 'IP-filter module failed to load.' @@ -79,7 +79,7 @@ ipfilter_start() case ${OSTYPE} in FreeBSD) ${ipfilter_program:-/sbin/ipf} -Fa -f \ - "${ipfilter_rules}" ${ipfilter_flags} + "${ipfilter_rules}" ${ipfilter_flags} ;; NetBSD) /sbin/ipf -E -Fa @@ -115,7 +115,7 @@ ipfilter_reload() case ${OSTYPE} in FreeBSD) ${ipfilter_program:-/sbin/ipf} -I -Fa -f \ - "${ipfilter_rules}" ${ipfilter_flags} + "${ipfilter_rules}" ${ipfilter_flags} ;; NetBSD) /sbin/ipf -I -Fa diff --git a/etc/rc.d/ipfw b/etc/rc.d/ipfw index 92c88e9..0c4d85c 100644 --- a/etc/rc.d/ipfw +++ b/etc/rc.d/ipfw @@ -18,8 +18,8 @@ stop_cmd="${SYSCTL_W} net.inet.ip.fw.enable=0" ipfw_precmd() { - if ! ${SYSCTL} net.inet.ip.fw.enable > /dev/null 2>&1 ; then - if ! kldload ipfw ; then + if ! ${SYSCTL} net.inet.ip.fw.enable > /dev/null 2>&1; then + if ! kldload ipfw; then warn unable to load firewall module. return 1 fi @@ -39,10 +39,10 @@ ipfw_start() # Network Address Translation daemon # - if checkyesno natd_enable ; then + if checkyesno natd_enable; then if [ -n "${natd_interface}" ]; then if echo ${natd_interface} | \ - grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then + grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then natd_flags="$natd_flags -a ${natd_interface}" else natd_flags="$natd_flags -n ${natd_interface}" diff --git a/etc/rc.d/ipmon b/etc/rc.d/ipmon index 0e7c804..12ef6cc 100755 --- a/etc/rc.d/ipmon +++ b/etc/rc.d/ipmon @@ -26,10 +26,10 @@ esac ipmon_precmd() { - # Make sure ipfilter is loaded before continuing - if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1 ; then - return 1 - fi + # Make sure ipfilter is loaded before continuing + if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then + return 1 + fi return 0 } diff --git a/etc/rc.d/ipnat b/etc/rc.d/ipnat index 1edb845..b9c4512 100755 --- a/etc/rc.d/ipnat +++ b/etc/rc.d/ipnat @@ -35,7 +35,7 @@ extra_commands="reload" ipnat_precmd() { # Make sure ipfilter is loaded before continuing - if ! ${SYSCTL} net.inet.ipf.fr_pass >/dev/null 2>&1 ; then + if ! ${SYSCTL} net.inet.ipf.fr_pass >/dev/null 2>&1; then err 'ipnat requires ipfilter be loaded' return 1 fi @@ -56,7 +56,7 @@ ipnat_start() echo '.' # restore filter/NAT state tables after loading the rules - if checkyesno ipfs_enable ; then + if checkyesno ipfs_enable; then if [ -r "/var/db/ipf/ipstate.ipf" ]; then echo -n ' ipfs' ${ipfs_program:-/sbin/ipfs} -R ${ipfs_flags} diff --git a/etc/rc.d/isdnd b/etc/rc.d/isdnd index 40f93bf..d194184 100644 --- a/etc/rc.d/isdnd +++ b/etc/rc.d/isdnd @@ -65,7 +65,7 @@ isdnd_start() # Start isdntrace # - if checkyesno isdn_trace ; then + if checkyesno isdn_trace; then echo -n ' isdntrace' nohup /usr/sbin/isdntrace ${isdn_traceflags} >/dev/null 2>&1 & echo '.' diff --git a/etc/rc.d/mountcritremote b/etc/rc.d/mountcritremote index 7438cad..1fbb389 100755 --- a/etc/rc.d/mountcritremote +++ b/etc/rc.d/mountcritremote @@ -35,7 +35,7 @@ mountcritremote_precmd() case "`mount -d -a -t nfs 2> /dev/null`" in *mount_nfs*) # Handle absent nfs client support - if ! sysctl vfs.nfs >/dev/null 2>&1 ; then + if ! sysctl vfs.nfs >/dev/null 2>&1; then kldload nfsclient || warn 'nfs mount ' \ 'requested, but no nfs client in kernel' \ return 1 @@ -55,7 +55,7 @@ mountcritremote_start() mount -a -t nfs echo '.' - # Mount other network filesystems if present in /etc/fstab + # Mount other network filesystems if present in /etc/fstab. for i in ${networkfs_types}; do fstype=${i%:*} fsdecr=${i#*:} @@ -71,7 +71,7 @@ mountcritremote_start() esac done - # Cleanup /var again just in case it's a network mount + # Cleanup /var again just in case it's a network mount. /etc/rc.d/cleanvar start rm -f /var/run/clean_var /var/spool/lock/clean_var ;; diff --git a/etc/rc.d/mountd b/etc/rc.d/mountd index 0f62548..eb8806b 100755 --- a/etc/rc.d/mountd +++ b/etc/rc.d/mountd @@ -23,7 +23,7 @@ mountd_precmd() FreeBSD) if ! checkyesno rpcbind_enable && \ ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then + then force_depend rpcbind || return 1 fi @@ -31,12 +31,12 @@ mountd_precmd() # case ${nfs_server_enable} in [Yy][Ee][Ss]) - if checkyesno weak_mountd_authentication ; then + if checkyesno weak_mountd_authentication; then mountd_flags="${mountd_flags} -n" fi ;; *) - if checkyesno mountd_enable ; then + if checkyesno mountd_enable; then checkyesno weak_mountd_authentication && mountd_flags="-n" fi esac diff --git a/etc/rc.d/named b/etc/rc.d/named index f4ac4c7..0bd5cac 100755 --- a/etc/rc.d/named +++ b/etc/rc.d/named @@ -52,18 +52,18 @@ chroot_autoupdate() cp -p /usr/libexec/named-xfer "${named_chrootdir}/usr/libexec" fi - # Copy /dev/null over, if neccessary. Preserve everything (perms, - # ownership, mod times). - # - if [ ! -c "${named_chrootdir}/dev/null" ]; then - rm -f "${named_chrootdir}/dev/null" - ( cd /dev ; /bin/pax -rw -pe null "${named_chrootdir}/dev" ) - fi + # Copy /dev/null over, if neccessary. Preserve everything (perms, + # ownership, mod times). + # + if [ ! -c "${named_chrootdir}/dev/null" ]; then + rm -f "${named_chrootdir}/dev/null" + ( cd /dev ; /bin/pax -rw -pe null "${named_chrootdir}/dev" ) + fi - # Copy local timezone information if it's not up-to-date. - # - if [ -f /etc/localtime ]; then - cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || \ + # Copy local timezone information if it's not up-to-date. + # + if [ -f /etc/localtime ]; then + cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || \ cp -p /etc/localtime "${named_chrootdir}/etc/localtime" fi } diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index a79aa5f..5b3aeb0 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -28,8 +28,8 @@ case ${log_in_vain} in esac [ "${log_in_vain}" -ne 0 ] && ( - echo -n " log_in_vain=${log_in_vain}" - sysctl net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null - sysctl net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null + echo -n " log_in_vain=${log_in_vain}" + sysctl net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null + sysctl net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null ) echo '.' diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index ae00cfd..4887042 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -15,50 +15,50 @@ stop_cmd="network_stop" convert_host_conf() { - host_conf=$1; shift; - nsswitch_conf=$1; shift; - awk ' \ - /^[:blank:]*#/ { next } \ - /(hosts|local|file)/ { nsswitch[c] = "files"; c++; next } \ - /(dns|bind)/ { nsswitch[c] = "dns"; c++; next } \ - /nis/ { nsswitch[c] = "nis"; c++; next } \ - { printf "Warning: unrecognized line [%s]", $0 > "/dev/stderr" } \ - END { \ - printf "hosts: "; \ - for (i in nsswitch) printf "%s ", nsswitch[i]; \ - printf "\n"; \ - }' < $host_conf > $nsswitch_conf + host_conf=$1; shift; + nsswitch_conf=$1; shift; + awk ' \ + /^[:blank:]*#/ { next } \ + /(hosts|local|file)/ { nsswitch[c] = "files"; c++; next } \ + /(dns|bind)/ { nsswitch[c] = "dns"; c++; next } \ + /nis/ { nsswitch[c] = "nis"; c++; next } \ + { printf "Warning: unrecognized line [%s]", $0 > "/dev/stderr" } \ + END { \ + printf "hosts: "; \ + for (i in nsswitch) printf "%s ", nsswitch[i]; \ + printf "\n"; \ + }' < $host_conf > $nsswitch_conf } generate_host_conf() { - nsswitch_conf=$1; shift; - host_conf=$1; shift; - - awk ' -BEGIN { - xlat["files"] = "hosts"; - xlat["dns"] = "bind"; - xlat["nis"] = "nis"; - cont = 0; -} -sub(/^[\t ]*hosts:/, "") || cont { - if (!cont) - srcs = "" - sub(/#.*/, "") - gsub(/[][]/, " & ") - cont = sub(/\\$/, "") - srcs = srcs " " $0 -} -END { - print "# Auto-generated from nsswitch.conf, do not edit" - ns = split(srcs, s) - for (n = 1; n <= ns; ++n) { - if (s[n] in xlat) - print xlat[s[n]] - } -} -' <$nsswitch_conf >$host_conf + nsswitch_conf=$1; shift; + host_conf=$1; shift; + + awk ' + BEGIN { + xlat["files"] = "hosts"; + xlat["dns"] = "bind"; + xlat["nis"] = "nis"; + cont = 0; + } + sub(/^[\t ]*hosts:/, "") || cont { + if (!cont) + srcs = "" + sub(/#.*/, "") + gsub(/[][]/, " & ") + cont = sub(/\\$/, "") + srcs = srcs " " $0 + } + END { + print "# Auto-generated from nsswitch.conf, do not edit" + ns = split(srcs, s) + for (n = 1; n <= ns; ++n) { + if (s[n] in xlat) + print xlat[s[n]] + } + } + ' <$nsswitch_conf >$host_conf } network_gif_setup() { diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index a79aa5f..5b3aeb0 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -28,8 +28,8 @@ case ${log_in_vain} in esac [ "${log_in_vain}" -ne 0 ] && ( - echo -n " log_in_vain=${log_in_vain}" - sysctl net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null - sysctl net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null + echo -n " log_in_vain=${log_in_vain}" + sysctl net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null + sysctl net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null ) echo '.' diff --git a/etc/rc.d/network_ipv6 b/etc/rc.d/network_ipv6 index 31ed76d..24bdb67 100644 --- a/etc/rc.d/network_ipv6 +++ b/etc/rc.d/network_ipv6 @@ -200,14 +200,14 @@ network6_stf_setup() network6_static_routes_setup() { # Set up any static routes. - case ${ipv6_defaultrouter} in - [Nn][Oo] | '') - ;; - *) - ipv6_static_routes="default ${ipv6_static_routes}" - ipv6_route_default="default ${ipv6_defaultrouter}" - ;; - esac + case ${ipv6_defaultrouter} in + [Nn][Oo] | '') + ;; + *) + ipv6_static_routes="default ${ipv6_static_routes}" + ipv6_route_default="default ${ipv6_defaultrouter}" + ;; + esac case ${ipv6_static_routes} in [Nn][Oo] | '') ;; @@ -343,7 +343,7 @@ network_ipv6_start() ;; esac - if checkyesno ipv6_gateway_enable ; then + if checkyesno ipv6_gateway_enable; then # act as a router ${SYSCTL_W} net.inet6.ip6.forwarding=1 ${SYSCTL_W} net.inet6.ip6.accept_rtadv=0 @@ -371,7 +371,7 @@ network_ipv6_start() fi # Filter out interfaces on which IPv6 initialization failed. - if checkyesno ipv6_gateway_enable ; then + if checkyesno ipv6_gateway_enable; then ipv6_working_interfaces="" for i in ${ipv6_network_interfaces}; do laddr=`network6_getladdr $i exclude_tentative` @@ -401,7 +401,7 @@ network_ipv6_start() network6_faith_setup # Support for IPv4 address tacked onto an IPv6 address - if checkyesno ipv6_ipv4mapping ; then + if checkyesno ipv6_ipv4mapping; then echo 'IPv4 mapped IPv6 address support=YES' ${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null else diff --git a/etc/rc.d/nfsclient b/etc/rc.d/nfsclient index 87de36d..a44be7f 100644 --- a/etc/rc.d/nfsclient +++ b/etc/rc.d/nfsclient @@ -19,12 +19,12 @@ stop_cmd="unmount_all" nfsclient_precmd() { if ! sysctl vfs.nfs >/dev/null 2>&1; then - if ! kldload nfsclient ; then + if ! kldload nfsclient; then warn 'Could not load nfs client module' return 1 fi fi - return 0 + return 0 } nfsclient_start() diff --git a/etc/rc.d/nfsd b/etc/rc.d/nfsd index 547db33..db76590 100755 --- a/etc/rc.d/nfsd +++ b/etc/rc.d/nfsd @@ -44,7 +44,7 @@ nfsd_precmd() force_depend mountd || return 1 fi - if checkyesno nfs_reserved_port_only ; then + if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsrv.nfs_privport=1 > /dev/null fi diff --git a/etc/rc.d/nfsserver b/etc/rc.d/nfsserver index f62029e..e9b71d9 100644 --- a/etc/rc.d/nfsserver +++ b/etc/rc.d/nfsserver @@ -18,12 +18,12 @@ stop_cmd=":" nfsserver_start() { if ! sysctl vfs.nfsrv >/dev/null 2>&1; then - if ! kldload nfsserver ; then + if ! kldload nfsserver; then warn 'Could not load NFS server module' return 1 fi fi - return 0 + return 0 } load_rc_config $name diff --git a/etc/rc.d/ntpd b/etc/rc.d/ntpd index 5fe636f..da0ba6d 100755 --- a/etc/rc.d/ntpd +++ b/etc/rc.d/ntpd @@ -30,7 +30,7 @@ ntpd_precmd() fi # If running in a chroot cage, ensure that the appropriate files - # exist inside the cage, as well as helper symlinks into the cage + # exist inside the cage, as well as helper symlinks into the cage # from outside. # # As this is called after the is_running and required_dir checks diff --git a/etc/rc.d/ntpdate b/etc/rc.d/ntpdate index 7b96538..e7e6116 100755 --- a/etc/rc.d/ntpdate +++ b/etc/rc.d/ntpdate @@ -29,8 +29,8 @@ ntpdate_start() { if [ -z "$ntpdate_hosts" ]; then ntpdate_hosts=`awk ' - /^server[ \t]*127.127/ {next} - /^(server|peer)/ {print $2} + /^server[ \t]*127.127/ {next} + /^(server|peer)/ {print $2} ' /dev/null 2>&1 - if [ $? != 0 ] ; then + if [ $? != 0 ]; then break 1 fi @@ -160,7 +160,6 @@ pcvt_start() esac ;; esac - # on monochrome monitor, set color palette to use a higher intensity diff --git a/etc/rc.d/ppp b/etc/rc.d/ppp index 67638cb..990fb62 100644 --- a/etc/rc.d/ppp +++ b/etc/rc.d/ppp @@ -19,9 +19,9 @@ ppp_start() # Establish ppp mode. # if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \ - -a "${ppp_mode}" != "dedicated" \ - -a "${ppp_mode}" != "background" ]; then - ppp_mode="auto" + -a "${ppp_mode}" != "dedicated" \ + -a "${ppp_mode}" != "background" ]; then + ppp_mode="auto" fi ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}" diff --git a/etc/rc.d/ppp-user b/etc/rc.d/ppp-user index 67638cb..990fb62 100644 --- a/etc/rc.d/ppp-user +++ b/etc/rc.d/ppp-user @@ -19,9 +19,9 @@ ppp_start() # Establish ppp mode. # if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \ - -a "${ppp_mode}" != "dedicated" \ - -a "${ppp_mode}" != "background" ]; then - ppp_mode="auto" + -a "${ppp_mode}" != "dedicated" \ + -a "${ppp_mode}" != "background" ]; then + ppp_mode="auto" fi ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}" diff --git a/etc/rc.d/quota b/etc/rc.d/quota index a225880..d259882 100755 --- a/etc/rc.d/quota +++ b/etc/rc.d/quota @@ -20,7 +20,7 @@ stop_cmd="/usr/sbin/quotaoff -a" quota_start() { - if checkyesno check_quotas ; then + if checkyesno check_quotas; then echo -n 'Checking quotas:' quotacheck -a echo ' done.' diff --git a/etc/rc.d/random b/etc/rc.d/random index 1450b93..f024348 100644 --- a/etc/rc.d/random +++ b/etc/rc.d/random @@ -63,13 +63,13 @@ random_stop() rm -f ${entropy_file} oumask=`umask` umask 077 - if touch ${entropy_file} ; then + if touch ${entropy_file}; then entropy_file_confirmed="${entropy_file}" else # Try this as a reasonable alternative for read-only # roots, diskless workstations, etc. rm -f /var/db/entropy - if touch /var/db/entropy ; then + if touch /var/db/entropy; then entropy_file_confirmed=/var/db/entropy fi fi diff --git a/etc/rc.d/resolv b/etc/rc.d/resolv index cef6e8a..647e3b7 100644 --- a/etc/rc.d/resolv +++ b/etc/rc.d/resolv @@ -55,8 +55,8 @@ mount_md() # If there is a global system configuration file, suck it in. # if [ -r /etc/rc.subr ]; then - . /etc/rc.subr - load_rc_config $name + . /etc/rc.subr + load_rc_config $name elif [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs @@ -108,7 +108,7 @@ if [ ! -L /tmp ]; then chmod 01777 /tmp fi -if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then +if sysctl vfs.devfs.generation > /dev/null 2>&1; then # we have DEVFS, no worries... true else diff --git a/etc/rc.d/root b/etc/rc.d/root index a345893..77ae607 100755 --- a/etc/rc.d/root +++ b/etc/rc.d/root @@ -25,7 +25,7 @@ root_start() [Nn][Oo] | '') ;; *) - if ! mount -u -o rw / ; then + if ! mount -u -o rw /; then echo 'Mounting root filesystem rw failed, startup aborted' exit 1 fi diff --git a/etc/rc.d/rtadvd b/etc/rc.d/rtadvd index 39dc094..1398afd 100755 --- a/etc/rc.d/rtadvd +++ b/etc/rc.d/rtadvd @@ -27,25 +27,25 @@ esac rtadvd_precmd() { - if ! ${IS_GATEWAY} ; then + if ! ${IS_GATEWAY}; then warn \ "${name} cannot be used on IPv6 host, only on an IPv6 router." return 1 fi - # This should be enabled with a great care. - # You may want to fine-tune /etc/rtadvd.conf. - # - # And if you wish your rtadvd to receive and process - # router renumbering messages, specify your Router Renumbering - # security policy by -R option. - # - # See `man 3 ipsec_set_policy` for IPsec policy specification - # details. - # (CAUTION: This enables your routers prefix renumbering - # from another machine, so if you enable this, do it with - # enough care.) - # + # This should be enabled with a great care. + # You may want to fine-tune /etc/rtadvd.conf. + # + # And if you wish your rtadvd to receive and process + # router renumbering messages, specify your Router Renumbering + # security policy by -R option. + # + # See `man 3 ipsec_set_policy` for IPsec policy specification + # details. + # (CAUTION: This enables your routers prefix renumbering + # from another machine, so if you enable this, do it with + # enough care.) + # case ${OSTYPE} in FreeBSD) # If specific interfaces haven't been specified, diff --git a/etc/rc.d/sendmail b/etc/rc.d/sendmail index cfb38cd..0efaca7 100755 --- a/etc/rc.d/sendmail +++ b/etc/rc.d/sendmail @@ -86,7 +86,7 @@ run_rc_command "$1" case ${OSTYPE} in FreeBSD) required_files= - + if ! checkyesno sendmail_enable; then name="sendmail_submit" rcvar=`set_rcvar` diff --git a/etc/rc.d/serial b/etc/rc.d/serial index 8b030d6..d9802d8 100644 --- a/etc/rc.d/serial +++ b/etc/rc.d/serial @@ -151,7 +151,7 @@ terminal() { # modem c c 00 01 02 03 04 05 06 07 # Initialize all ports on a Cyclades-16ye. -# modem c c 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f +# modem c c 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f # Initialize all ports on a Digiboard 8. # modem D D 00 01 02 03 04 05 06 07 diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp index cef6e8a..647e3b7 100644 --- a/etc/rc.d/tmp +++ b/etc/rc.d/tmp @@ -55,8 +55,8 @@ mount_md() # If there is a global system configuration file, suck it in. # if [ -r /etc/rc.subr ]; then - . /etc/rc.subr - load_rc_config $name + . /etc/rc.subr + load_rc_config $name elif [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs @@ -108,7 +108,7 @@ if [ ! -L /tmp ]; then chmod 01777 /tmp fi -if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then +if sysctl vfs.devfs.generation > /dev/null 2>&1; then # we have DEVFS, no worries... true else diff --git a/etc/rc.d/var b/etc/rc.d/var index cef6e8a..647e3b7 100644 --- a/etc/rc.d/var +++ b/etc/rc.d/var @@ -55,8 +55,8 @@ mount_md() # If there is a global system configuration file, suck it in. # if [ -r /etc/rc.subr ]; then - . /etc/rc.subr - load_rc_config $name + . /etc/rc.subr + load_rc_config $name elif [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs @@ -108,7 +108,7 @@ if [ ! -L /tmp ]; then chmod 01777 /tmp fi -if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then +if sysctl vfs.devfs.generation > /dev/null 2>&1; then # we have DEVFS, no worries... true else diff --git a/etc/rc.d/wscons b/etc/rc.d/wscons index 9bb6e11..36fd1b1 100755 --- a/etc/rc.d/wscons +++ b/etc/rc.d/wscons @@ -139,16 +139,16 @@ wscons_start() mapfile) mapfile=$arg1 ( while read entry; do - case "$entry" in - \#*|"") - continue - ;; + case "$entry" in + \#*|"") + continue + ;; *) - cmd="$wsctl -w \"map+=$entry\"" - cmd="$cmd >/dev/null" - eval $DOIT $cmd - ;; - esac + cmd="$wsctl -w \"map+=$entry\"" + cmd="$cmd >/dev/null" + eval $DOIT $cmd + ;; + esac done ) < $mapfile ;; diff --git a/etc/rc.d/ypserv b/etc/rc.d/ypserv index 166869d..1619769 100755 --- a/etc/rc.d/ypserv +++ b/etc/rc.d/ypserv @@ -27,8 +27,8 @@ esac ypserv_precmd() { - case ${OSTYPE} in - FreeBSD) + case ${OSTYPE} in + FreeBSD) if ! checkyesno rpcbind_enable && \ ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 then diff --git a/etc/rc.d/ypset b/etc/rc.d/ypset index 577b545..006e946 100644 --- a/etc/rc.d/ypset +++ b/etc/rc.d/ypset @@ -28,11 +28,11 @@ ypset_precmd() force_depend ypbind || return 1 fi - _domain=`domainname` - if [ -z "$_domain" ]; then - warn "domainname(1) is not set." - return 1 - fi + _domain=`domainname` + if [ -z "$_domain" ]; then + warn "domainname(1) is not set." + return 1 + fi } load_rc_config $name diff --git a/etc/rc.d/ypupdated b/etc/rc.d/ypupdated index 6e8b193..1dc43f5 100644 --- a/etc/rc.d/ypupdated +++ b/etc/rc.d/ypupdated @@ -27,11 +27,11 @@ rpc_ypupdated_precmd() force_depend ypserv || return 1 fi - _domain=`domainname` - if [ -z "$_domain" ]; then - warn "domainname(1) is not set." - return 1 - fi + _domain=`domainname` + if [ -z "$_domain" ]; then + warn "domainname(1) is not set." + return 1 + fi } load_rc_config $name diff --git a/etc/rc.d/ypxfrd b/etc/rc.d/ypxfrd index cf873fb..bfb3b16 100644 --- a/etc/rc.d/ypxfrd +++ b/etc/rc.d/ypxfrd @@ -28,11 +28,11 @@ ypxfrd_precmd() force_depend ypserv || return 1 fi - _domain=`domainname` - if [ -z "$_domain" ]; then - warn "domainname(1) is not set." - return 1 - fi + _domain=`domainname` + if [ -z "$_domain" ]; then + warn "domainname(1) is not set." + return 1 + fi } load_rc_config $name diff --git a/etc/rc.initdiskless b/etc/rc.initdiskless index 6722365..faa2acb 100644 --- a/etc/rc.initdiskless +++ b/etc/rc.initdiskless @@ -81,19 +81,19 @@ bootp_ipa="" bootp_ipbca="" iflist=`ifconfig -l` for i in ${iflist} ; do - set `ifconfig ${i}` - while [ $# -ge 1 ] ; do - if [ "${bootp_ifc}" = "" -a "$1" = "inet" ] ; then - bootp_ifc=${i} ; bootp_ipa=${2} ; shift - fi - if [ "${bootp_ipbca}" = "" -a "$1" = "broadcast" ] ; then - bootp_ipbca=$2; shift - fi - shift - done - if [ "${bootp_ifc}" != "" ] ; then - break - fi + set `ifconfig ${i}` + while [ $# -ge 1 ] ; do + if [ "${bootp_ifc}" = "" -a "$1" = "inet" ]; then + bootp_ifc=${i} ; bootp_ipa=${2} ; shift + fi + if [ "${bootp_ipbca}" = "" -a "$1" = "broadcast" ]; then + bootp_ipbca=$2; shift + fi + shift + done + if [ "${bootp_ifc}" != "" ]; then + break + fi done echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" -- cgit v1.1