diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-03-06 21:28:57 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-03-06 21:28:57 +0000 |
commit | b77680287eec673a7e97897465b10eaab538c639 (patch) | |
tree | 28bc68a9fe8b1b353bf704f843b8d7bc696f31e0 /package/base-files/files/etc/init.d | |
parent | 18b744818aee67025ffca0a7672818814d146eed (diff) | |
download | mtk-20170518-b77680287eec673a7e97897465b10eaab538c639.zip mtk-20170518-b77680287eec673a7e97897465b10eaab538c639.tar.gz mtk-20170518-b77680287eec673a7e97897465b10eaab538c639.tar.bz2 |
add new config option for the hostname in /etc/config/system (fixes #1302, #1438)
SVN-Revision: 6532
Diffstat (limited to 'package/base-files/files/etc/init.d')
-rwxr-xr-x | package/base-files/files/etc/init.d/boot | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index ed5e7d8..c644b2f 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -2,13 +2,22 @@ # Copyright (C) 2006 OpenWrt.org START=10 + +system_config() { + local cfg="$1" + local hostname + + config_get hostname "$cfg" hostname + echo "${hostname:-OpenWrt}" > /proc/sys/kernel/hostname +} + start() { [ -f /proc/mounts ] || /sbin/mount_root [ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc vconfig set_name_type DEV_PLUS_VID_NO_PAD - HOSTNAME=${wan_hostname%%.*} - echo ${HOSTNAME:=OpenWrt}>/proc/sys/kernel/hostname + config_load system + config_foreach system_config system mkdir -p /var/run mkdir -p /var/log |