Skip to content

Commit

Permalink
Update adguardhome.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
lanpter authored Apr 15, 2021
1 parent ce89e34 commit 9fe39ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions trunk/user/adguardhome/adguardhome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,33 +138,33 @@ fi

dl_adg(){
logger -t "AdGuardHome" "下载AdGuardHome"
#wget --no-check-certificate -O /tmp/AdGuardHome.tar.gz https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.101.0/AdGuardHome_linux_mipsle.tar.gz
curl -k -s -o /tmp/AdGuardHome/AdGuardHome --connect-timeout 10 --retry 3 https://cdn.jsdelivr.net/gh/chongshengB/rt-n56u/trunk/user/adguardhome/AdGuardHome
if [ ! -f "/tmp/AdGuardHome/AdGuardHome" ]; then
#wget --no-check-certificate -O /opt/AdGuardHome.tar.gz https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.101.0/AdGuardHome_linux_mipsle.tar.gz
curl -k -s -o /opt/AdGuardHome/AdGuardHome --connect-timeout 10 --retry 3 https://cdn.jsdelivr.net/gh/lanpter/rt-n56u/trunk/user/adguardhome/AdGuardHome
if [ ! -f "/opt/AdGuardHome/AdGuardHome" ]; then
logger -t "AdGuardHome" "AdGuardHome下载失败,请检查是否能正常访问github!程序将退出。"
nvram set adg_enable=0
exit 0
else
logger -t "AdGuardHome" "AdGuardHome下载成功。"
chmod 777 /tmp/AdGuardHome/AdGuardHome
chmod 777 /opt/AdGuardHome/AdGuardHome
fi
}

start_adg(){
mkdir -p /tmp/AdGuardHome
mkdir -p /opt/AdGuardHome
mkdir -p /etc/storage/AdGuardHome
if [ ! -f "/tmp/AdGuardHome/AdGuardHome" ]; then
if [ ! -f "/opt/AdGuardHome/AdGuardHome" ]; then
dl_adg
fi
getconfig
change_dns
set_iptable
logger -t "AdGuardHome" "运行AdGuardHome"
eval "/tmp/AdGuardHome/AdGuardHome -c $adg_file -w /tmp/AdGuardHome -v" &
eval "/opt/AdGuardHome/AdGuardHome -c $adg_file -w /opt/AdGuardHome -v" &

}
stop_adg(){
rm -rf /tmp/AdGuardHome
rm -rf /opt/AdGuardHome
killall -9 AdGuardHome
del_dns
clear_iptable
Expand Down

0 comments on commit 9fe39ce

Please sign in to comment.