Merge branch 'feature/type/__hostname/openwrt-support' into 'master'

__hostname: Add support for OpenWrt

See merge request ungleich-public/cdist!947
This commit is contained in:
poljakowski 2020-11-08 13:23:36 +01:00
commit 1b3e1acd22
2 changed files with 7 additions and 0 deletions

View file

@ -69,6 +69,9 @@ in
centos|fedora|redhat|scientific|freebsd|netbsd|openbsd|gentoo|void) centos|fedora|redhat|scientific|freebsd|netbsd|openbsd|gentoo|void)
echo "hostname '$name_should'" echo "hostname '$name_should'"
;; ;;
openwrt)
echo "echo '$name_should' >/proc/sys/kernel/hostname"
;;
macosx) macosx)
echo "scutil --set HostName '$name_should'" echo "scutil --set HostName '$name_should'"
;; ;;

View file

@ -149,6 +149,10 @@ in
openbsd) openbsd)
echo "$name_should" | __file /etc/myname --source - echo "$name_should" | __file /etc/myname --source -
;; ;;
openwrt)
__uci system.@system[0].hostname --value "$name_should"
# --transaction hostname
;;
slackware) slackware)
# We write the FQDN into /etc/HOSTNAME. But /etc/rc.d/rc.M will only # We write the FQDN into /etc/HOSTNAME. But /etc/rc.d/rc.M will only
# read the first component from this file and set it as the running # read the first component from this file and set it as the running