1
0
mirror of https://github.com/laurivosandi/certidude synced 2025-09-09 23:11:12 +00:00

Integrate LEDE image builder

This commit is contained in:
2018-01-03 22:12:02 +00:00
parent 345c2802ea
commit fba8f5d776
18 changed files with 386 additions and 62 deletions

View File

@@ -0,0 +1,21 @@
MODEL=$(cat /etc/board.json | jsonfilter -e '@["model"]["id"]')
# Hostname prefix
case $MODEL in
tl-*|archer-*) VENDOR=tplink ;;
cf-*) VENDOR=comfast ;;
*) VENDOR=ap ;;
esac
# Network interface with relevant MAC address
case $MODEL in
tl-wdr*) NIC=wlan1 ;;
archer-*) NIC=eth1 ;;
cf-e380ac-v2) NIC=eth0 ;;
*) NIC=wlan0 ;;
esac
HOSTNAME=$VENDOR-$(cat /sys/class/net/$NIC/address | cut -d : -f 4- | sed -e 's/://g')
uci set system.@system[0].hostname=$HOSTNAME
uci set network.lan.hostname=$HOSTNAME