You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
749 B

  1. #!/bin/sh
  2. # Warning, problems can occur if the device restarts in the middle of this uci-default script
  3. if [ -x /bin/sysrepoctl ]; then
  4. match=$(sysrepoctl -l | grep "ietf-keystore ")
  5. if [ ! "$match" ]; then
  6. sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore@2019-07-02.yang -o root:root -p 600
  7. if [ -x /bin/sysrepocfg ]; then
  8. sysrepocfg -f xml -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
  9. rm /usr/share/netopeer2-keystored/stock_key_config.xml
  10. fi
  11. #generate ssh keys
  12. if [ ! -f "/etc/keystored/keys/ssh_host_rsa_key.pem" ]; then
  13. ssh-keygen -m pem -t rsa -q -N "" -f /etc/keystored/keys/ssh_host_rsa_key.pem
  14. chmod go-rw /etc/keystored/keys/ssh_host_rsa_key.pem
  15. fi
  16. fi
  17. fi
  18. exit 0