mirror of
https://github.com/Snowy-Fluffy/zapret.installer.git
synced 2026-07-15 21:59:24 +03:00
timeout 10s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user