mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 03:40:03 +00:00
Crafty Controller: Wait for credentials file instead of fixed sleep (#13670)
This commit is contained in:
parent
daaa137cec
commit
ecb4d36d6a
1 changed files with 12 additions and 6 deletions
|
|
@ -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
|
||||||
|
[[ -f "$CREDS_FILE" ]] && break
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
if [[ -f "$CREDS_FILE" ]]; then
|
||||||
|
{
|
||||||
echo "Crafty-Controller-Credentials"
|
echo "Crafty-Controller-Credentials"
|
||||||
echo "Username: $(grep -oP '(?<="username": ")[^"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)"
|
echo "Username: $(grep -oP '(?<="username": ")[^"]*' "$CREDS_FILE")"
|
||||||
echo "Password: $(grep -oP '(?<="password": ")[^"]*' /opt/crafty-controller/crafty/crafty-4/app/config/default-creds.txt)"
|
echo "Password: $(grep -oP '(?<="password": ")[^"]*' "$CREDS_FILE")"
|
||||||
} >>~/crafty-controller.creds
|
} >>~/crafty-controller.creds
|
||||||
|
fi
|
||||||
msg_ok "Service started"
|
msg_ok "Service started"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue