2023-04-07 19:45:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
echo "Confluent first boot is running"
|
2023-04-12 15:22:27 +00:00
|
|
|
HOME=$(getent passwd $(whoami)|cut -d: -f 6)
|
|
|
|
export HOME
|
2023-04-07 19:45:31 +00:00
|
|
|
#cp -a /etc/confluent/ssh/* /etc/ssh/
|
|
|
|
#systemctl restart sshd
|
|
|
|
rootpw=$(grep ^rootpassword: /etc/confluent/confluent.deploycfg |awk '{print $2}')
|
|
|
|
if [ ! -z "$rootpw" -a "$rootpw" != "null" ]; then
|
|
|
|
echo root:$rootpw | chpasswd -e
|
|
|
|
fi
|
|
|
|
nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
|
|
|
|
confluent_apikey=$(cat /etc/confluent/confluent.apikey)
|
|
|
|
confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg |awk '{print $2}')
|
|
|
|
while ! ping -c 1 $confluent_mgr >& /dev/null; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
source /etc/confluent/functions
|
|
|
|
|
|
|
|
run_remote_parts firstboot.d
|
|
|
|
run_remote_config firstboot.d
|
|
|
|
systemctl disable firstboot
|
|
|
|
curl -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" -X POST -d "status: complete" https://$confluent_mgr/confluent-api/self/updatestatus
|