`shfmt -i 4 -ci test`

So as to make diff less.
pull/104/head
IceCodeNew 2020-09-19 17:19:38 +08:00 committed by GitHub
parent 2ce0418303
commit cd8d0d4870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 39 deletions

View File

@ -41,7 +41,7 @@ identify_the_operating_system_and_architecture() {
'armv6l') 'armv6l')
MACHINE='arm32-v6' MACHINE='arm32-v6'
;; ;;
'armv7' | 'armv7l' ) 'armv7' | 'armv7l')
MACHINE='arm32-v7a' MACHINE='arm32-v7a'
;; ;;
'armv8' | 'aarch64') 'armv8' | 'aarch64')
@ -108,47 +108,47 @@ identify_the_operating_system_and_architecture() {
} }
## Demo function for processing parameters ## Demo function for processing parameters
judgment_parameters() { judgment_parameters() {
while [[ "$#" -gt '0' ]]; do while [[ "$#" -gt '0' ]]; do
case "$1" in case "$1" in
'--remove') '--remove')
if [[ "$#" -gt '1' ]]; then if [[ "$#" -gt '1' ]]; then
echo 'error: Please enter the correct parameters.' echo 'error: Please enter the correct parameters.'
exit 1 exit 1
fi fi
REMOVE='1' REMOVE='1'
;; ;;
'--version') '--version')
VERSION="${2:?error: Please specify the correct version.}" VERSION="${2:?error: Please specify the correct version.}"
break ##跳出while break ##跳出while
;; ;;
'-c' | '--check') '-c' | '--check')
CHECK='1' CHECK='1'
break ##跳出while break ##跳出while
;; ;;
'-f' | '--force') '-f' | '--force')
FORCE='1' FORCE='1'
break ##跳出while break ##跳出while
;; ;;
'-l' | '--local') '-l' | '--local')
LOCAL_INSTALL='1' LOCAL_INSTALL='1'
LOCAL_FILE="${2:?error: Please specify the correct local file.}" LOCAL_FILE="${2:?error: Please specify the correct local file.}"
break ##跳出while break ##跳出while
;; ;;
'-p' | '--proxy') '-p' | '--proxy')
if echo "${2:?undefine var}" | grep -qEo '^(http|https|socks4|socks4a|socks5|socks5h)://'; then if echo "${2:?undefine var}" | grep -qEo '^(http|https|socks4|socks4a|socks5|socks5h)://'; then
echo 'error: Please specify the correct proxy server address.' echo 'error: Please specify the correct proxy server address.'
exit 1
fi
PROXY="-x$2"
shift ## 参数左移
;;
*)
show_help
exit 1 exit 1
fi ;;
PROXY="-x$2"
shift ## 参数左移
;;
*)
show_help
exit 1
;;
esac esac
shift ## 参数左移 shift ## 参数左移
done done
} }
@ -300,7 +300,7 @@ install_v2ray() {
# Install V2Ray configuration file to $JSON_PATH # Install V2Ray configuration file to $JSON_PATH
if [[ ! -d "$JSON_PATH" ]]; then if [[ ! -d "$JSON_PATH" ]]; then
install -d "$JSON_PATH" install -d "$JSON_PATH"
echo "{}" > "${JSON_PATH}config.json" echo "{}" >"${JSON_PATH}config.json"
CONFIG_NEW='1' CONFIG_NEW='1'
fi fi