diff options
author | root <root@rshg054.dnsready.net> | 2011-11-09 23:14:53 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2011-11-09 23:14:53 +0000 |
commit | 7b0cdd65ac7bcd3c7597b528a10de58e4e0a430f (patch) | |
tree | 94f5e5e8ba53712358886d7a29554a7c5d624563 /testing/dhcpcd/0001-Set-hostname-via-proc-if-file-is-available.patch | |
parent | ddba9670c1518d9b420db6a6dca01a4a4a4136c7 (diff) |
Wed Nov 9 23:14:53 UTC 2011
Diffstat (limited to 'testing/dhcpcd/0001-Set-hostname-via-proc-if-file-is-available.patch')
-rw-r--r-- | testing/dhcpcd/0001-Set-hostname-via-proc-if-file-is-available.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/dhcpcd/0001-Set-hostname-via-proc-if-file-is-available.patch b/testing/dhcpcd/0001-Set-hostname-via-proc-if-file-is-available.patch new file mode 100644 index 000000000..4420d0b63 --- /dev/null +++ b/testing/dhcpcd/0001-Set-hostname-via-proc-if-file-is-available.patch @@ -0,0 +1,33 @@ +From d345b36b483fec8fb2def5f3acdc2d3c5faa94eb Mon Sep 17 00:00:00 2001 +From: Dan McGee <dan@archlinux.org> +Date: Sun, 19 Jun 2011 16:04:25 -0500 +Subject: [PATCH] Set hostname via /proc if file is available + +On Linux, the hostname can be set via this file if available, precluding +the need for a `hostname` binary. + +Signed-off-by: Dan McGee <dan@archlinux.org> +--- + dhcpcd-hooks/30-hostname | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/dhcpcd-hooks/30-hostname b/dhcpcd-hooks/30-hostname +index 65d1a13..af94262 100644 +--- a/dhcpcd-hooks/30-hostname ++++ b/dhcpcd-hooks/30-hostname +@@ -21,7 +21,11 @@ need_hostname() + try_hostname() + { + if valid_domainname "$1"; then +- hostname "$1" ++ if [ -w /proc/sys/kernel/hostname ]; then ++ echo "$1" > /proc/sys/kernel/hostname ++ else ++ hostname "$1" ++ fi + else + syslog err "Invalid hostname: $1" + fi +-- +1.7.5.4 + |