-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,514 additions
and
922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
shopt -s failglob | ||
|
||
local_path=$(dirname $0) | ||
|
||
: ${SYSREPOCTL:=sysrepoctl} | ||
: ${SYSREPOCTL_ROOT_PERMS:=-o root:root -p 600} | ||
: ${YANG_DIR:=$local_path/../../modules} | ||
|
||
install_yang_module() { | ||
module=$1 | ||
|
||
if ! $SYSREPOCTL -l | grep "$module[^|]*|[^|]*| Installed[^\\n]*"; then | ||
$SYSREPOCTL -i -g ${YANG_DIR}/$module.yang $SYSREPOCTL_ROOT_PERMS | ||
fi | ||
} | ||
|
||
install_yang_module ietf-x509-cert-to-name | ||
install_yang_module ietf-keystore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
shopt -s failglob | ||
|
||
local_path=$(dirname $0) | ||
|
||
: ${SYSREPOCFG:=sysrepocfg} | ||
: ${CHMOD:=chmod} | ||
: ${OPENSSL:=openssl} | ||
: ${STOCK_KEY_CONFIG:=$local_path/../stock_key_config.xml} | ||
: ${KEYSTORED_KEYS_DIR:=/etc/keystored/keys} | ||
|
||
if [ -n "$($SYSREPOCFG -d startup --export ietf-keystore)" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ $KEYSTORED_CHECK_SSH_KEY -eq 0 ]; then | ||
echo "Warning: Assuming that an external script will provide the SSH key in a PEM format at \"${KEYSTORED_KEYS_DIR}/ssh_host_rsa_key.pem\"." | ||
$SYSREPOCFG -d startup -i ${STOCK_KEY_CONFIG} ietf-keystore | ||
elif [ -r /etc/ssh/ssh_host_rsa_key ]; then | ||
cp /etc/ssh/ssh_host_rsa_key ${KEYSTORED_KEYS_DIR}/ssh_host_rsa_key.pem | ||
$CHMOD go-rw ${KEYSTORED_KEYS_DIR}/ssh_host_rsa_key.pem | ||
$OPENSSL rsa -pubout -in ${KEYSTORED_KEYS_DIR}/ssh_host_rsa_key.pem \ | ||
-out ${KEYSTORED_KEYS_DIR}/ssh_host_rsa_key.pub.pem | ||
$SYSREPOCFG -d startup -i ${STOCK_KEY_CONFIG} ietf-keystore | ||
else | ||
echo "Warning: Cannot read the SSH hostkey at /etc/ssh/ssh_host_rsa_key, skipping" | ||
fi |
Oops, something went wrong.