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