install.sh: allow insecure connections fix #23
This commit is contained in:
parent
f0f7eb22f3
commit
143f068708
@ -29,7 +29,7 @@
|
||||
|
||||
- Execute install script (Multi-architecture support)
|
||||
```shell
|
||||
sh -c "$(curl -sS https://raw.githubusercontent.com/sbwml/luci-app-mosdns/master/install.sh)"
|
||||
sh -c "$(curl -ksS https://raw.githubusercontent.com/sbwml/luci-app-mosdns/master/install.sh)"
|
||||
```
|
||||
|
||||
--------------
|
||||
|
14
install.sh
14
install.sh
@ -11,7 +11,7 @@ platform=$(opkg print-architecture | awk 'END{print $2}')
|
||||
TMPDIR=$(mktemp -d) || exit 1
|
||||
|
||||
# GitHub mirror
|
||||
ip_info=$(curl -s https://ip.cooluc.com)
|
||||
ip_info=$(curl -sk https://ip.cooluc.com)
|
||||
country_code=$(echo $ip_info | sed -r 's/.*country_code":"([^"]*).*/\1/')
|
||||
if [ $country_code = "CN" ]; then
|
||||
google_status=$(curl -I -4 -m 3 -o /dev/null -s -w %{http_code} http://www.google.com/generate_204)
|
||||
@ -47,7 +47,7 @@ CHECK() (
|
||||
DOWNLOAD() (
|
||||
echo -e "\r\n${GREEN_COLOR}Download Packages ...${RES}\r\n"
|
||||
# get repos info
|
||||
curl -s --connect-timeout 10 "https://api.github.com/repos/sbwml/luci-app-mosdns/releases" | grep "browser_download_url" > $TMPDIR/releases.txt
|
||||
curl -sk --connect-timeout 10 "https://api.github.com/repos/sbwml/luci-app-mosdns/releases" | grep "browser_download_url" > $TMPDIR/releases.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED_COLOR}Failed to get version information, Please check the network status.${RES}"
|
||||
rm -rf $TMPDIR
|
||||
@ -65,35 +65,35 @@ DOWNLOAD() (
|
||||
|
||||
# download
|
||||
echo -e "${GREEN_COLOR}Download $mosdns ...${RES}"
|
||||
curl --connect-timeout 30 -m 600 -Lo "$TMPDIR/mosdns_$platform.ipk" $mirror$mosdns
|
||||
curl --connect-timeout 30 -m 600 -kLo "$TMPDIR/mosdns_$platform.ipk" $mirror$mosdns
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED_COLOR}Error! download $mosdns failed.${RES}"
|
||||
rm -rf $TMPDIR
|
||||
exit 1
|
||||
fi
|
||||
echo -e "${GREEN_COLOR}Download $luci_app ...${RES}"
|
||||
curl --connect-timeout 30 -m 600 -Lo "$TMPDIR/luci-app-mosdns.ipk" $mirror$luci_app
|
||||
curl --connect-timeout 30 -m 600 -kLo "$TMPDIR/luci-app-mosdns.ipk" $mirror$luci_app
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED_COLOR}Error! download $luci_app failed.${RES}"
|
||||
rm -rf $TMPDIR
|
||||
exit 1
|
||||
fi
|
||||
echo -e "${GREEN_COLOR}Download $luci_i18n ...${RES}"
|
||||
curl --connect-timeout 30 -m 600 -Lo "$TMPDIR/luci-i18n-mosdns-zh-cn.ipk" $mirror$luci_i18n
|
||||
curl --connect-timeout 30 -m 600 -kLo "$TMPDIR/luci-i18n-mosdns-zh-cn.ipk" $mirror$luci_i18n
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED_COLOR}Error! download $luci_i18n failed.${RES}"
|
||||
rm -rf $TMPDIR
|
||||
exit 1
|
||||
fi
|
||||
echo -e "${GREEN_COLOR}Download $geoip ...${RES}"
|
||||
curl --connect-timeout 30 -m 600 -Lo "$TMPDIR/geoip.ipk" $mirror$geoip
|
||||
curl --connect-timeout 30 -m 600 -kLo "$TMPDIR/geoip.ipk" $mirror$geoip
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED_COLOR}Error! download $geoip failed.${RES}"
|
||||
rm -rf $TMPDIR
|
||||
exit 1
|
||||
fi
|
||||
echo -e "${GREEN_COLOR}Download $geosite ...${RES}"
|
||||
curl --connect-timeout 30 -m 600 -Lo "$TMPDIR/geosite.ipk" $mirror$geosite
|
||||
curl --connect-timeout 30 -m 600 -kLo "$TMPDIR/geosite.ipk" $mirror$geosite
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED_COLOR}Error! download $geosite failed.${RES}"
|
||||
rm -rf $TMPDIR
|
||||
|
Loading…
Reference in New Issue
Block a user