timeout 10s

This commit is contained in:
Snowy-Fluffy
2025-08-24 17:09:59 +03:00
parent 88acc5a133
commit 7c231ccb6a

View File

@@ -2,7 +2,7 @@
remote_latest_version() {
rver=$(timeout 5s curl -s https://api.github.com/repos/bol-van/zapret/releases/latest | \
rver=$(timeout 10s curl -s https://api.github.com/repos/bol-van/zapret/releases/latest | \
grep "tag_name" | \
cut -d '"' -f 4 | \
sed 's/^v//')
@@ -16,15 +16,15 @@ get_latest_version() {
fi
}
zapret_update_check()
{
if cmp -s <(get_latest_version) /opt/zapret-ver; then
echo -e "0"
else
echo -e "1"
fi
}
#zapret_update_check()
#{
# if cmp -s <(get_latest_version) /opt/zapret-ver; then
# echo -e "0"
# else
# echo -e "1"
# fi
#
#}
download_zapret()
{
@@ -170,13 +170,12 @@ update_zapret() {
cp -r /opt/zapret/ipset/zapret-hosts-user.txt $TEMP_DIR_CONF/zapret-hosts-user.txt
LIST_EXISTS=1
fi
if [ $(zapret_update_check) = 0 ]; then
echo "Актуальная версия уже установлена: нечего обновлять."
bash -c 'read -p "Нажмите Enter для продолжения..."'
else
#if [ $(zapret_update_check) = 0 ]; then
# echo "Актуальная версия уже установлена: нечего обновлять."
# bash -c 'read -p "Нажмите Enter для продолжения..."'
download_zapret || error_exit "не удалось обновить запрет"
echo -e "Запрет обновлен до версии $(cat /opt/zapret-ver)"
fi
cd /opt/zapret
sed -i '238s/ask_yes_no N/ask_yes_no Y/' /opt/zapret/common/installer.sh
yes "" | ./install_easy.sh