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
818 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.yang -o root:root -p 600
  7. if [ -x /bin/sysrepocfg ]; then
  8. sysrepocfg -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. ssh-keygen -t rsa -f /tmp/ssh_host_rsa_key -N ""
  13. openssl rsa -in /tmp/ssh_host_rsa_key -outform pem > /etc/keystored/keys/ssh_host_rsa_key.pem
  14. openssl rsa -pubout -in /etc/keystored/keys/ssh_host_rsa_key.pem -out /etc/keystored/keys/ssh_host_rsa_key.pub.pem
  15. rm /tmp/ssh_host_rsa_key
  16. fi
  17. fi
  18. exit 0