wlan-ap-Telecominfraproject/feeds/tip/certificates/files/etc/init.d/certificates
John Crispin ce20001751 certificates: decouple mount and copy logic
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00

23 lines
641 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=80
copy_certificates() {
[ -f /certificates/key.pem ] || return
cp /certificates/*.pem /etc/ucentral/
[ -f /certificates/dev-id ] && cp /certificates/dev-id /etc/ucentral/
chown root.network /etc/ucentral/*.pem
chmod 0440 root.network /etc/ucentral/*.pem
[ -f /etc/ucentral/dev-id] && chmod 0400 /etc/ucentral/dev-id
[ -f /certificates/restrictions.json ] && cp /certificates/restrictions.json /etc/ucentral/
[ -f /certificates/sign_pubkey.pem ] && cp /certificates/sign_pubkey.pem /etc/ucentral/
exit 0
}
boot() {
[ -f /etc/ucentral/dev-id ] && return
/usr/bin/mount_certs
copy_certificates
}