mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-05 20:47:57 +00:00
9d6c6495bf
autoinstall is run without a tty, so detect that and use tty1 instead. Also, clean up agama config by avoiding too many duplicated network entries.
30 lines
1.0 KiB
Bash
30 lines
1.0 KiB
Bash
#!/bin/bash
|
|
serialcons=$(tty)
|
|
if [ -e /run/confluent/01-autocons.conf ]; then
|
|
serialcons=$(cat /run/confluent/01-autocons.conf|sed -e s/.*=// -e s/,.*//)
|
|
if [ -n "$serialcons" ]; then
|
|
serialcons=/dev/$serialcons
|
|
else
|
|
serialcons=$(tty)
|
|
fi
|
|
fi
|
|
if [ "$serialcons" = "not a tty" ]; then
|
|
serialcons="/dev/tty1"
|
|
elif [ -z "$serialcons" ]; then
|
|
serialcons="/dev/tty1"
|
|
fi
|
|
profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
export profile
|
|
python3 /opt/confluent/bin/apiclient /confluent-public/os/$profile/scripts/functions > /etc/confluent/functions
|
|
. /etc/confluent/functions
|
|
touch /tmp/confluent-pre.log
|
|
tail -f /tmp/confluent-pre.log > $serialcons 2>&1 &
|
|
tailpid=$!
|
|
python3 /opt/confluent/bin/apiclient /confluent-public/os/$profile/scripts/pre.sh > /tmp/pre.sh 2> $serialcons
|
|
chmod +x /tmp/pre.sh
|
|
/tmp/pre.sh > $serialcons 2>&1
|
|
kill $tailpid
|
|
agama config load /tmp/autoinstall.json <> $serialcons > $serialcons 2>&1
|
|
agama install <> $serialcons > $serialcons 2>&1
|
|
agama finish <> $serialcons > $serialcons 2>&1
|