Change to function
parent
45f823dd06
commit
65fc443163
|
@ -12,7 +12,7 @@
|
|||
# If the script executes incorrectly, go to:
|
||||
# https://github.com/v2fly/fhs-install-v2ray/issues
|
||||
|
||||
# Identify the operating system and architecture
|
||||
identify_the_operating_system_and_architecture() {
|
||||
if [[ "$(uname)" == 'Linux' ]]; then
|
||||
case "$(uname -m)" in
|
||||
'i386' | 'i686')
|
||||
|
@ -82,8 +82,9 @@ else
|
|||
echo "error: This operating system is not supported."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Judgment parameters
|
||||
judgment_parameters() {
|
||||
if [[ "$#" -gt '0' ]]; then
|
||||
case "$1" in
|
||||
'--remove')
|
||||
|
@ -186,6 +187,7 @@ if [[ "$#" -gt '0' ]]; then
|
|||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
install_software() {
|
||||
COMPONENT="$1"
|
||||
|
@ -457,6 +459,9 @@ show_help() {
|
|||
}
|
||||
|
||||
main() {
|
||||
identify_the_operating_system_and_architecture
|
||||
judgment_parameters "$@"
|
||||
|
||||
# Parameter information
|
||||
[[ "$HELP" -eq '1' ]] && show_help
|
||||
[[ "$CHECK" -eq '1' ]] && check_update
|
||||
|
@ -538,4 +543,4 @@ main() {
|
|||
fi
|
||||
}
|
||||
|
||||
main
|
||||
main "$@"
|
||||
|
|
Loading…
Reference in New Issue