2022-10-20 10:41:39 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
[ -n "$1" ] && UUID="$1"
|
|
|
|
[ -n "$2" ] && REMOTE_IP="$2"
|
|
|
|
|
2022-10-20 16:32:00 +02:00
|
|
|
if [ -n "$UUID" ] && [ "$UUID" != "<UUID>" ] && [ -n "$REMOTE_IP" ] && [ "$REMOTE_IP" != "<REMOTE_IP>" ]; then
|
2022-10-20 10:41:39 +02:00
|
|
|
mkdir -p /var/lib/keylime/cv_ca
|
|
|
|
mkdir -p /etc/keylime/agent.conf.d
|
|
|
|
cat <<EOF > /etc/keylime/agent.conf.d/agent.conf
|
|
|
|
[agent]
|
|
|
|
|
|
|
|
uuid = "$UUID"
|
|
|
|
registrar_ip = "$REMOTE_IP"
|
|
|
|
revocation_notification_ip = "$REMOTE_IP"
|
|
|
|
run_as = "root:root"
|
|
|
|
EOF
|
|
|
|
fi
|