The script should not involve data updates of package management software
parent
e3f730b2fb
commit
6effa0a0da
|
@ -62,20 +62,16 @@ if [[ "$(uname)" == 'Linux' ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [[ "$(command -v apt)" ]]; then
|
if [[ "$(command -v apt)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_UPDATE='apt update'
|
|
||||||
PACKAGE_MANAGEMENT_INSTALL='apt install'
|
PACKAGE_MANAGEMENT_INSTALL='apt install'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='apt remove'
|
PACKAGE_MANAGEMENT_REMOVE='apt remove'
|
||||||
elif [[ "$(command -v yum)" ]]; then
|
elif [[ "$(command -v yum)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_UPDATE='yum makecache'
|
|
||||||
PACKAGE_MANAGEMENT_INSTALL='yum install'
|
PACKAGE_MANAGEMENT_INSTALL='yum install'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='yum remove'
|
PACKAGE_MANAGEMENT_REMOVE='yum remove'
|
||||||
if [[ "$(command -v dnf)" ]]; then
|
if [[ "$(command -v dnf)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_UPDATE='dnf makecache'
|
|
||||||
PACKAGE_MANAGEMENT_INSTALL='dnf install'
|
PACKAGE_MANAGEMENT_INSTALL='dnf install'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='dnf remove'
|
PACKAGE_MANAGEMENT_REMOVE='dnf remove'
|
||||||
fi
|
fi
|
||||||
elif [[ "$(command -v zypper)" ]]; then
|
elif [[ "$(command -v zypper)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_UPDATE='zypper refresh'
|
|
||||||
PACKAGE_MANAGEMENT_INSTALL='zypper install'
|
PACKAGE_MANAGEMENT_INSTALL='zypper install'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='zypper remove'
|
PACKAGE_MANAGEMENT_REMOVE='zypper remove'
|
||||||
else
|
else
|
||||||
|
@ -478,13 +474,11 @@ main() {
|
||||||
echo 'warn: Install V2Ray from a local file, but still need to make sure the network is available.'
|
echo 'warn: Install V2Ray from a local file, but still need to make sure the network is available.'
|
||||||
echo -n 'warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
|
echo -n 'warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
|
||||||
read
|
read
|
||||||
${PACKAGE_MANAGEMENT_UPDATE}
|
|
||||||
install_software unzip
|
install_software unzip
|
||||||
mkdir "$TMP_DIRECTORY"
|
mkdir "$TMP_DIRECTORY"
|
||||||
decompression "$LOCAL_FILE"
|
decompression "$LOCAL_FILE"
|
||||||
else
|
else
|
||||||
# Normal way
|
# Normal way
|
||||||
${PACKAGE_MANAGEMENT_UPDATE}
|
|
||||||
get_version
|
get_version
|
||||||
NUMBER="$?"
|
NUMBER="$?"
|
||||||
if [[ "$NUMBER" -eq '0' ]] || [[ "$FORCE" -eq '1' ]] || [[ "$NUMBER" -eq 2 ]]; then
|
if [[ "$NUMBER" -eq '0' ]] || [[ "$FORCE" -eq '1' ]] || [[ "$NUMBER" -eq 2 ]]; then
|
||||||
|
|
Loading…
Reference in New Issue