mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 05:10:40 +00:00
Crafty Controller: Wait for credentials file instead of fixed sleep (#13670)
This commit is contained in:
committed by
GitHub
parent
daaa137cec
commit
ecb4d36d6a
@@ -67,12 +67,18 @@ Restart=on-failure
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
$STD systemctl enable -q --now crafty-controller
|
$STD systemctl enable -q --now crafty-controller
|
||||||
sleep 10
|
CREDS_FILE="/opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt"
|
||||||
{
|
for i in $(seq 1 30); do
|
||||||
echo "Crafty-Controller-Credentials"
|
[[ -f "$CREDS_FILE" ]] && break
|
||||||
echo "Username: $(grep -oP '(?<="username": ")[^"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)"
|
sleep 2
|
||||||
echo "Password: $(grep -oP '(?<="password": ")[^"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)"
|
done
|
||||||
} >>~/crafty-controller.creds
|
if [[ -f "$CREDS_FILE" ]]; then
|
||||||
|
{
|
||||||
|
echo "Crafty-Controller-Credentials"
|
||||||
|
echo "Username: $(grep -oP '(?<="username": ")[^"]*' "$CREDS_FILE")"
|
||||||
|
echo "Password: $(grep -oP '(?<="password": ")[^"]*' "$CREDS_FILE")"
|
||||||
|
} >>~/crafty-controller.creds
|
||||||
|
fi
|
||||||
msg_ok "Service started"
|
msg_ok "Service started"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user