chore: more PR comments
This commit is contained in:
parent
b9d415e7a1
commit
b26c7e7d45
@ -14,19 +14,6 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
wait_for_api() {
|
||||
msg_info "Waiting for API to become available..."
|
||||
while true; do
|
||||
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:19200/api/system/info" 2>/dev/null || echo "000")
|
||||
if [ "$HTTP_STATUS" -eq 200 ]; then
|
||||
msg_ok "API is now available!"
|
||||
break
|
||||
fi
|
||||
msg_info "API not ready yet (status: $HTTP_STATUS). Retrying in 5 seconds..."
|
||||
sleep 5
|
||||
done
|
||||
}
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
curl \
|
||||
@ -46,7 +33,6 @@ $STD apt update
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
$STD apt-get install -t bookworm-backports ffmpeg -y
|
||||
rm -rf /etc/apt/sources.list.d/backports.list deb-multimedia-keyring_2016.8.1_all.deb
|
||||
$STD apt update
|
||||
msg_ok "Installed FFmpeg"
|
||||
|
||||
msg_info "Setting Up Hardware Acceleration"
|
||||
@ -103,7 +89,7 @@ wait_for_api
|
||||
ffmpeg_uid=$(curl -s -X 'GET' "http://localhost:19200/api/variable/name/ffmpeg" -H 'accept: application/json' | jq -r '.Uid')
|
||||
ffprobe_uid=$(curl -s -X 'GET' "http://localhost:19200/api/variable/name/ffprobe" -H 'accept: application/json' | jq -r '.Uid')
|
||||
|
||||
$STD curl -s -X 'DELETE' \
|
||||
response=$(curl -s -X 'DELETE' \
|
||||
"http://localhost:19200/api/variable" \
|
||||
-H 'accept: */*' \
|
||||
-H 'Content-Type: application/json' \
|
||||
@ -112,22 +98,22 @@ $STD curl -s -X 'DELETE' \
|
||||
\"$ffmpeg_uid\",
|
||||
\"$ffprobe_uid\"
|
||||
]
|
||||
}"
|
||||
}")
|
||||
|
||||
ffmpeg_path=$(which ffmpeg)
|
||||
ffprobe_path=$(which ffprobe)
|
||||
|
||||
$STD curl -s -X 'POST' \
|
||||
response=$(curl -s -X 'POST' \
|
||||
"http://localhost:19200/api/variable" \
|
||||
-H 'accept: */*' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{\"Name\":\"ffmpeg\",\"Value\":\"$ffmpeg_path\"}"
|
||||
-d "{\"Name\":\"ffmpeg\",\"Value\":\"$ffmpeg_path\"}")
|
||||
|
||||
$STD curl -s -X 'POST' \
|
||||
response=$(curl -s -X 'POST' \
|
||||
"http://localhost:19200/api/variable" \
|
||||
-H 'accept: */*' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{\"Name\":\"ffprobe\",\"Value\":\"$ffprobe_path\"}"
|
||||
-d "{\"Name\":\"ffprobe\",\"Value\":\"$ffprobe_path\"}")
|
||||
|
||||
msg_ok "ffmpeg and ffprobe variables have been updated successfully."
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user