mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 09:49:28 +08:00
fix compatibility issue with sh.
This commit is contained in:
@@ -10,8 +10,11 @@ is_openwrt() {
|
|||||||
|
|
||||||
# Function to ensure the proxy URL ends with a /
|
# Function to ensure the proxy URL ends with a /
|
||||||
ensure_trailing_slash() {
|
ensure_trailing_slash() {
|
||||||
if [ -n "$1" ] && [ "${1: -1}" != "/" ]; then
|
if [ -n "$1" ]; then
|
||||||
echo "$1/"
|
case "$1" in
|
||||||
|
*/) echo "$1" ;;
|
||||||
|
*) echo "$1/" ;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
echo "$1"
|
echo "$1"
|
||||||
fi
|
fi
|
||||||
@@ -23,7 +26,7 @@ UNINSTALL=false
|
|||||||
CHINA_MAINLAND=false
|
CHINA_MAINLAND=false
|
||||||
GITHUB_URL="https://github.com"
|
GITHUB_URL="https://github.com"
|
||||||
GITHUB_API_URL="https://api.github.com"
|
GITHUB_API_URL="https://api.github.com"
|
||||||
GITHUB_PROXY_URL="https://ghfast.top/" # Default proxy URL
|
GITHUB_PROXY_URL="https://ghfast.top/" # Default proxy URL
|
||||||
KEY=""
|
KEY=""
|
||||||
|
|
||||||
# Check for help flag first
|
# Check for help flag first
|
||||||
|
@@ -19,8 +19,11 @@ GITHUB_PROXY_URL="https://ghfast.top/" # Default proxy URL
|
|||||||
|
|
||||||
# Function to ensure the proxy URL ends with a /
|
# Function to ensure the proxy URL ends with a /
|
||||||
ensure_trailing_slash() {
|
ensure_trailing_slash() {
|
||||||
if [ -n "$1" ] && [ "${1: -1}" != "/" ]; then
|
if [ -n "$1" ]; then
|
||||||
echo "$1/"
|
case "$1" in
|
||||||
|
*/) echo "$1" ;;
|
||||||
|
*) echo "$1/" ;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
echo "$1"
|
echo "$1"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user