Parameter identification and correction

pull/1/head
Dct Mei 2020-04-12 11:22:09 +08:00
parent 47f73bf301
commit e3f730b2fb
No known key found for this signature in database
GPG Key ID: 50BF8B712DCAD7EA
1 changed files with 138 additions and 143 deletions

View File

@ -12,8 +12,8 @@
# If the script executes incorrectly, go to:
# https://github.com/v2fly/fhs-install-v2ray/issues
identify_the_operating_system_and_architecture() {
if [[ "$(uname)" == 'Linux' ]]; then
# Identify the operating system and architecture
if [[ "$(uname)" == 'Linux' ]]; then
case "$(uname -m)" in
'i386' | 'i686')
MACHINE='32'
@ -82,14 +82,13 @@ identify_the_operating_system_and_architecture() {
echo "error: The script does not support the package manager in this operating system."
exit 1
fi
else
else
echo "error: This operating system is not supported."
exit 1
fi
}
fi
judgment_parameters() {
if [[ "$#" -gt '0' ]]; then
# Judgment parameters
if [[ "$#" -gt '0' ]]; then
case "$1" in
'--remove')
if [[ "$#" -gt '1' ]]; then
@ -191,8 +190,7 @@ judgment_parameters() {
exit 1
;;
esac
fi
}
fi
install_software() {
COMPONENT="$1"
@ -466,10 +464,7 @@ show_help() {
}
main() {
identify_the_operating_system_and_architecture
judgment_parameters
# helping information
# Parameter information
[[ "$HELP" -eq '1' ]] && show_help
[[ "$CHECK" -eq '1' ]] && check_update
[[ "$REMOVE" -eq '1' ]] && remove_v2ray