summaryrefslogtreecommitdiffstats
path: root/package/network/utils/modemsignal-leds/files/modemsignal-leds.defaults
blob: 8e467469f38daceb61d4541fe5e5021b8b7e3eb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# First boot / install: if the user hasn't configured modemsignal-leds and a
# profile ships for this board, install it as the default config. Devices that
# are auto-discoverable (single modem, one set of *:signal*, *:rssi* or
# *:mobile* LEDs) need no profile.
board=$(cat /tmp/sysinfo/board_name 2>/dev/null)
prof="/usr/share/modemsignal-leds/profiles/$board"

# leave any existing user config untouched
uci -q show modemsignal-leds 2>/dev/null | grep -q '=modem$' && exit 0
[ -n "$board" ] && [ -f "$prof" ] || exit 0

cp "$prof" /etc/config/modemsignal-leds
exit 0