diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-03-17 16:12:27 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2017-12-13 14:54:03 +0100 |
commit | f173464f13102e6901c60de417b50b44d93bcbde (patch) | |
tree | f7de0ea48f4291d9541eec0e818f8f415bc740c7 /package/base-files | |
parent | 62a8252a0f32d6c148e4565354fd6a99da13fa41 (diff) | |
download | upstream-f173464f13102e6901c60de417b50b44d93bcbde.tar.gz upstream-f173464f13102e6901c60de417b50b44d93bcbde.tar.bz2 upstream-f173464f13102e6901c60de417b50b44d93bcbde.zip |
base-files: add generic board_name function to functions.sh
This will be used to replace all those nasty board specific scripts
that do basically the same thing
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit ec991424749b9eed37d01bc8adb9fb22fb0c98a7)
Diffstat (limited to 'package/base-files')
-rwxr-xr-x | package/base-files/files/lib/functions.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 992d88f964..bea5f0f96b 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -353,4 +353,8 @@ user_exists() { grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd } +board_name() { + [ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic" +} + [ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh |