Browse Source

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 <[email protected]>
Felix Fietkau 8 years ago
parent
commit
ec99142474
1 changed files with 4 additions and 0 deletions
  1. 4 0
      package/base-files/files/lib/functions.sh

+ 4 - 0
package/base-files/files/lib/functions.sh

@@ -353,4 +353,8 @@ user_exists() {
 	grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd
 	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
 [ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh