Recette pour la création de l'image sabnzbd
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#!/usr/bin/env bash
## Simple test script that sees if the SABnzbd server is up within a certain number# of seconds (TOTAL_ATTEMPTS * SLEEP_TIME). If it isn't up in time or the HTTP# code returned is not 200, then it exits out with an error code.
TOTAL_ATTEMPTS=10SLEEP_TIME=6
function connect_server { http_code=$(curl -sL -w "%{http_code}\\n" "http://localhost:8080/" -o /dev/null) curl_exit=$?}
attempts=0until [ $attempts -ge $TOTAL_ATTEMPTS ]do connect_server [ "$curl_exit" == "0" ] && break attempts=$[$attempts+1] sleep $SLEEP_TIMEdone
if [ "$http_code" != "200" ]then echo "Received HTTP $http_code from SABnzbd port (last curl exit code: $curl_exit)" exit 1fi
|