summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/bin/servconfig
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-04-05 13:14:22 +0200
committerDirk von Suchodoletz2007-04-05 13:14:22 +0200
commit4baeba0199d218df4353eb430f2f9cda55fb3acf (patch)
treec0bacd1dcb0d2dc531f72dda001eaed3fca15886 /initramfs/initrd-stuff/bin/servconfig
parentWriting halt script for SuSE systems from functions-*, see #111 (diff)
downloadcore-4baeba0199d218df4353eb430f2f9cda55fb3acf.tar.gz
core-4baeba0199d218df4353eb430f2f9cda55fb3acf.tar.xz
core-4baeba0199d218df4353eb430f2f9cda55fb3acf.zip
Fix for preparation of /etc/hosts file (if more than one domain name
given) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@864 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff/bin/servconfig')
-rwxr-xr-xinitramfs/initrd-stuff/bin/servconfig19
1 files changed, 13 insertions, 6 deletions
diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig
index 0fa0d395..ed1a209f 100755
--- a/initramfs/initrd-stuff/bin/servconfig
+++ b/initramfs/initrd-stuff/bin/servconfig
@@ -153,16 +153,23 @@ echo -e "# /etc/hosts - file generated by\n#\t$0:\n#\t$date\
fe00::0\t\tipv6-localnet\nff00::0\t\tipv6-mcastprefix\nff02::1\
\t\tipv6-allnodes\nff02::2\t\tipv6-allrouters\nff02::3\t\t\
ipv6-allhosts\n" >/mnt/etc/hosts
-echo -e "$clientip\t$host_name.$domain_name $host_name\n" >>/mnt/etc/hosts
-
+if [ -n "$domain_name" ]; then
+ echo -en "$clientip\t" >>/mnt/etc/hosts
+ for name in $domain_name; do
+ echo -en "$host_name.$name " >>/mnt/etc/hosts
+ done
+ echo -e "$host_name" >>/mnt/etc/hosts
+else
+ echo -e "$clientip\t$host_name" >>/mnt/etc/hosts
+fi
# set up domainname and resolving
test -n "$domain_name" && \
echo -e "# /etc/resolv.conf - file generated by\n#\t$0:\n\
#\t$date\n#options timeout:1 attempts:1 rotate\n\
search "$domain_name >/mnt/etc/resolv.conf
test -n "$domain_name_servers" && {
- for nameserver in $domain_name_servers; do
- echo nameserver $nameserver >>/mnt/etc/resolv.conf;
+ for name in $domain_name_servers; do
+ echo name $nameserver >>/mnt/etc/resolv.conf;
done; }
#############################################################################
@@ -253,8 +260,8 @@ config_bt
if [ -n "$ntp_servers" -a ! -f /rootfs/etc/ntp.conf ]; then
echo -e "# /etc/ntp.conf - file generated by $0: \
$date\n" >/mnt/etc/ntp.conf
- for ntpserver in $ntp_servers; do
- echo server $ntpserver >>/mnt/etc/ntp.conf
+ for name in $ntp_servers; do
+ echo server $name >>/mnt/etc/ntp.conf
done
fi
# copy timezone file defined with language settings