Files
wlan-ap/feeds/tip/certificates/files/etc/init.d/certificates
2021-10-13 10:51:21 +02:00

22 lines
639 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=80
boot() {
[ -f /etc/ucentral/dev-id ] && return
. /lib/functions.sh
mkdir -p /certificates /etc/ucentral/
local mtd=$(find_mtd_index certificates)
[ -n "$mtd" -a -f /sys/class/mtd/mtd$mtd/oobsize ] && ubiattach -p /dev/mtd$mtd
if [ -n "$(ubinfo -a | grep certificates)" ]; then
[ -e /dev/ubi0 ] && mount -t ubifs ubi0:certificates /certificates
[ -e /dev/ubi1 ] && mount -t ubifs ubi1:certificates /certificates
else
mount -t squashfs /dev/mtdblock$mtd /certificates
fi
[ -f /certificates/dev-id ] && {
cp /certificates/*.pem /etc/ucentral/
cp /certificates/dev-id /etc/ucentral/
}
}