Check connect
This commit is contained in:
parent
3b590001a9
commit
6f44f2b493
|
@ -17,6 +17,15 @@ torrent_init()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_connect()
|
||||||
|
{
|
||||||
|
if [ -n "$(curl --head -s $instance_point/config | grep 'HTTP\/. 200')" ]; then
|
||||||
|
echo 'OK'
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
peertube_api_check_ratelimit()
|
peertube_api_check_ratelimit()
|
||||||
{
|
{
|
||||||
curl -s --head "$instance_point/" | grep rate
|
curl -s --head "$instance_point/" | grep rate
|
||||||
|
@ -226,6 +235,10 @@ menu_settings()
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ -z $(check_connect) ]; then
|
||||||
|
echo 'Connect error...'
|
||||||
|
echo 'Please retry later or switch instance'
|
||||||
|
fi
|
||||||
version=$(peertube_api_version_server)
|
version=$(peertube_api_version_server)
|
||||||
torrent_init
|
torrent_init
|
||||||
videosmenu='All Videos'
|
videosmenu='All Videos'
|
||||||
|
@ -273,6 +286,10 @@ while true; do
|
||||||
cat $instance_hist | sort | uniq | tee $instance_hist 1>>/dev/null
|
cat $instance_hist | sort | uniq | tee $instance_hist 1>>/dev/null
|
||||||
export instance
|
export instance
|
||||||
export instance_point="https://$instance/api/v1"
|
export instance_point="https://$instance/api/v1"
|
||||||
|
if [ -z $(check_connect) ]; then
|
||||||
|
echo 'Connect error...'
|
||||||
|
echo 'Please retry later or switch instance'
|
||||||
|
fi
|
||||||
export version=$(peertube_api_version_server)
|
export version=$(peertube_api_version_server)
|
||||||
conf_instance_state=$(echo 'Permanent\nTemporaly' | fzy)
|
conf_instance_state=$(echo 'Permanent\nTemporaly' | fzy)
|
||||||
if [ "$conf_instance_state" = 'Permanent' ]; then
|
if [ "$conf_instance_state" = 'Permanent' ]; then
|
||||||
|
|
Loading…
Reference in New Issue