diff --git a/README.md b/README.md index bc2ec71..161f259 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,54 @@ or # bash install-release.sh --remove ``` +### 證書權限問題 + +假設,這書文件所在的路徑為 `/srv/http/`。 + +文件分別為 `/srv/http/example.com.key` 和 `/srv/http/example.com.pem`。 + +方案一: + +1. `/srv/http/` 的默認權限一般為 755; +2. `/srv/http/example.com.key` 的默認權限一般為 600; +3. `/srv/http/example.com.pem` 的默認權限一般為 644。 + +將 `/srv/http/example.com.key` 修改為 644 即可: + +``` +# chmod 644 /srv/http/example.com.key +``` + +方案二: + +``` +# id nobody +``` + +1. 显示出来的结果可能是: + + ``` + uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup) + ``` + + 相应的,只需要执行: + + ``` + # chown -R nobody:nogroup /srv/http/ + ``` + +2. 显示出来的结果也可能是: + + ``` + uid=65534(nobody) gid=65534(nobody) groups=65534(nobody) + ``` + + 相应的,只需要执行: + + ``` + # chown -R nobody:nobody /srv/http/ + ``` + ## 參數 ``` diff --git a/install-dat-release.sh b/install-dat-release.sh index 6a0c652..dbd876c 100644 --- a/install-dat-release.sh +++ b/install-dat-release.sh @@ -26,11 +26,11 @@ check_if_running_as_root() { } download_geoip() { - if ! curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.new" "$DOWNLOAD_LINK_GEOIP"; then + if ! curl -s -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.new" "$DOWNLOAD_LINK_GEOIP"; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi - if ! curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOIP.sha256sum"; then + if ! curl -s -L -H 'Cache-Control: no-cache' -o "${V2RAY}geoip.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOIP.sha256sum"; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi @@ -43,11 +43,11 @@ download_geoip() { } download_geosite() { - if ! curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.new" "$DOWNLOAD_LINK_GEOSITE"; then + if ! curl -s -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.new" "$DOWNLOAD_LINK_GEOSITE"; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi - if ! curl -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOSITE.sha256sum"; then + if ! curl -s -L -H 'Cache-Control: no-cache' -o "${V2RAY}geosite.dat.sha256sum.new" "$DOWNLOAD_LINK_GEOSITE.sha256sum"; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi