From 2cb1b8432993cdb63eb60310780dda5bec2ab78c Mon Sep 17 00:00:00 2001 From: ke hu Date: Thu, 9 May 2019 11:29:33 +0200 Subject: [PATCH] ICWMP: generate symlink for certificate on startup refs #15952 after the software is upgraded a new symlink needs to be created' to the certificate that ICWMP uses for encrypted traffic --- icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts b/icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts index 6f62cd3ef..460d3280a 100644 --- a/icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts +++ b/icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts @@ -41,4 +41,14 @@ set_cwmp_reqopts() { fi } +regenerate_ssl_link(){ + local cert_dir="/etc/ssl/certs" + local all_file=$(ls $cert_dir/*.pem) + for cfile in $all_file + do + ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0 + done +} + set_cwmp_reqopts +regenerate_ssl_link