aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.d
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2000-09-06 18:16:48 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2000-09-06 18:16:48 +0000
commit248aee623cc3e95cadc710fe1668269b841e171b (patch)
treeb144d034dc9f7c786d7dfcedd59cee6c9a125418 /etc/rc.d
parent57a12c8e24b4d67ccc12561633419985ab64985d (diff)
Notes
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/netoptions29
-rw-r--r--etc/rc.d/network129
-rw-r--r--etc/rc.d/network229
-rw-r--r--etc/rc.d/network329
-rw-r--r--etc/rc.d/routing29
5 files changed, 145 insertions, 0 deletions
diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions
index 51e02cd0787c..168f3bda209b 100644
--- a/etc/rc.d/netoptions
+++ b/etc/rc.d/netoptions
@@ -13,6 +13,18 @@
network_pass1() {
echo -n 'Doing initial network setup:'
+ # Convert host.conf to nsswitch.conf if necessary
+ if [ -f "/etc/host.conf" ]; then
+ echo ""
+ echo "Warning: /etc/host.conf is no longer used"
+ if [ -f "/etc/nsswitch.conf" ]; then
+ echo " /etc/nsswitch.conf will be used instead"
+ else
+ echo " /etc/nsswitch.conf will be created for you"
+ convert_host_conf /etc/host.conf /etc/nsswitch.conf
+ fi
+ fi
+
# Set the host name if it is not already set
#
if [ -z "`hostname -s`" ]; then
@@ -681,3 +693,20 @@ network_pass4() {
echo '.'
network_pass4_done=YES
}
+
+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
+}
+
diff --git a/etc/rc.d/network1 b/etc/rc.d/network1
index 51e02cd0787c..168f3bda209b 100644
--- a/etc/rc.d/network1
+++ b/etc/rc.d/network1
@@ -13,6 +13,18 @@
network_pass1() {
echo -n 'Doing initial network setup:'
+ # Convert host.conf to nsswitch.conf if necessary
+ if [ -f "/etc/host.conf" ]; then
+ echo ""
+ echo "Warning: /etc/host.conf is no longer used"
+ if [ -f "/etc/nsswitch.conf" ]; then
+ echo " /etc/nsswitch.conf will be used instead"
+ else
+ echo " /etc/nsswitch.conf will be created for you"
+ convert_host_conf /etc/host.conf /etc/nsswitch.conf
+ fi
+ fi
+
# Set the host name if it is not already set
#
if [ -z "`hostname -s`" ]; then
@@ -681,3 +693,20 @@ network_pass4() {
echo '.'
network_pass4_done=YES
}
+
+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
+}
+
diff --git a/etc/rc.d/network2 b/etc/rc.d/network2
index 51e02cd0787c..168f3bda209b 100644
--- a/etc/rc.d/network2
+++ b/etc/rc.d/network2
@@ -13,6 +13,18 @@
network_pass1() {
echo -n 'Doing initial network setup:'
+ # Convert host.conf to nsswitch.conf if necessary
+ if [ -f "/etc/host.conf" ]; then
+ echo ""
+ echo "Warning: /etc/host.conf is no longer used"
+ if [ -f "/etc/nsswitch.conf" ]; then
+ echo " /etc/nsswitch.conf will be used instead"
+ else
+ echo " /etc/nsswitch.conf will be created for you"
+ convert_host_conf /etc/host.conf /etc/nsswitch.conf
+ fi
+ fi
+
# Set the host name if it is not already set
#
if [ -z "`hostname -s`" ]; then
@@ -681,3 +693,20 @@ network_pass4() {
echo '.'
network_pass4_done=YES
}
+
+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
+}
+
diff --git a/etc/rc.d/network3 b/etc/rc.d/network3
index 51e02cd0787c..168f3bda209b 100644
--- a/etc/rc.d/network3
+++ b/etc/rc.d/network3
@@ -13,6 +13,18 @@
network_pass1() {
echo -n 'Doing initial network setup:'
+ # Convert host.conf to nsswitch.conf if necessary
+ if [ -f "/etc/host.conf" ]; then
+ echo ""
+ echo "Warning: /etc/host.conf is no longer used"
+ if [ -f "/etc/nsswitch.conf" ]; then
+ echo " /etc/nsswitch.conf will be used instead"
+ else
+ echo " /etc/nsswitch.conf will be created for you"
+ convert_host_conf /etc/host.conf /etc/nsswitch.conf
+ fi
+ fi
+
# Set the host name if it is not already set
#
if [ -z "`hostname -s`" ]; then
@@ -681,3 +693,20 @@ network_pass4() {
echo '.'
network_pass4_done=YES
}
+
+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
+}
+
diff --git a/etc/rc.d/routing b/etc/rc.d/routing
index 51e02cd0787c..168f3bda209b 100644
--- a/etc/rc.d/routing
+++ b/etc/rc.d/routing
@@ -13,6 +13,18 @@
network_pass1() {
echo -n 'Doing initial network setup:'
+ # Convert host.conf to nsswitch.conf if necessary
+ if [ -f "/etc/host.conf" ]; then
+ echo ""
+ echo "Warning: /etc/host.conf is no longer used"
+ if [ -f "/etc/nsswitch.conf" ]; then
+ echo " /etc/nsswitch.conf will be used instead"
+ else
+ echo " /etc/nsswitch.conf will be created for you"
+ convert_host_conf /etc/host.conf /etc/nsswitch.conf
+ fi
+ fi
+
# Set the host name if it is not already set
#
if [ -z "`hostname -s`" ]; then
@@ -681,3 +693,20 @@ network_pass4() {
echo '.'
network_pass4_done=YES
}
+
+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
+}
+