[type/__hostname] Add support for OpenWrt

This commit is contained in:
Dennis Camera 2020-06-11 21:27:53 +02:00
parent c7c3075f62
commit 10abe514b8
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