aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-03-17 16:12:27 +0100
committerFelix Fietkau <nbd@nbd.name>2017-03-22 11:43:21 +0100
commitec991424749b9eed37d01bc8adb9fb22fb0c98a7 (patch)
tree6be1edf924ccb27442eabe3a164296d6404c7f09 /package/base-files
parent76cc264364424013503a709551228edefd1167cd (diff)
downloadupstream-ec991424749b9eed37d01bc8adb9fb22fb0c98a7.tar.gz
upstream-ec991424749b9eed37d01bc8adb9fb22fb0c98a7.tar.bz2
upstream-ec991424749b9eed37d01bc8adb9fb22fb0c98a7.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>
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh4
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 b68db6b6bd..2b6415a200 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