Adjust judgment method

This commit is contained in:
Yuk1n0 2021-07-10 17:31:57 +08:00
parent 642138febb
commit c00549d2be
No known key found for this signature in database
GPG key ID: 19A0D6377E84BEE6

View file

@ -604,10 +604,12 @@ install_prepare() {
} }
install_libsodium() { install_libsodium() {
if [ ! -f /usr/lib/libsodium.a ] || [ ! -f /usr/lib64/libsodium.a ]; then if [ -f /usr/lib/libsodium.a ] || [ -f /usr/lib64/libsodium.a ]; then
echo
echo -e "[${green}Info${plain}] ${libsodium_file} already installed."
else
echo echo
echo -e "[${green}Info${plain}] ${libsodium_file} start installing." echo -e "[${green}Info${plain}] ${libsodium_file} start installing."
echo
cd ${cur_dir} || exit cd ${cur_dir} || exit
download "${libsodium_file}.tar.gz" "${libsodium_url}" download "${libsodium_file}.tar.gz" "${libsodium_url}"
tar zxf ${libsodium_file}.tar.gz tar zxf ${libsodium_file}.tar.gz
@ -619,17 +621,16 @@ install_libsodium() {
exit 1 exit 1
fi fi
echo -e "[${green}Info${plain}] ${libsodium_file} install success!" echo -e "[${green}Info${plain}] ${libsodium_file} install success!"
else
echo
echo -e "[${green}Info${plain}] ${libsodium_file} already installed."
fi fi
} }
install_mbedtls() { install_mbedtls() {
if [ ! -f /usr/lib/libmbedtls.a ] || [ ! -f /usr/lib64/libmbedtls.a ]; then if [ -f /usr/lib/libmbedtls.a ] || [ -f /usr/lib64/libmbedtls.a ]; then
echo
echo -e "[${green}Info${plain}] ${mbedtls_file} already installed."
else
echo echo
echo -e "[${green}Info${plain}] ${mbedtls_file} start installing." echo -e "[${green}Info${plain}] ${mbedtls_file} start installing."
echo
cd ${cur_dir} || exit cd ${cur_dir} || exit
download "mbedtls-${mbedtls_file}.tar.gz" "${mbedtls_url}" download "mbedtls-${mbedtls_file}.tar.gz" "${mbedtls_url}"
tar zxf mbedtls-${mbedtls_file}.tar.gz tar zxf mbedtls-${mbedtls_file}.tar.gz
@ -642,16 +643,12 @@ install_mbedtls() {
exit 1 exit 1
fi fi
echo -e "[${green}Info${plain}] ${mbedtls_file} install success!" echo -e "[${green}Info${plain}] ${mbedtls_file} install success!"
else
echo
echo -e "[${green}Info${plain}] ${mbedtls_file} already installed."
fi fi
} }
install_shadowsocks_libev() { install_shadowsocks_libev() {
echo echo
echo -e "[${green}Info${plain}] ${software[0]} start installing." echo -e "[${green}Info${plain}] ${software[0]} start installing."
echo
cd ${cur_dir} || exit cd ${cur_dir} || exit
tar zxf ${shadowsocks_libev_file}.tar.gz tar zxf ${shadowsocks_libev_file}.tar.gz
cd ${shadowsocks_libev_file} || exit cd ${shadowsocks_libev_file} || exit
@ -676,7 +673,6 @@ install_shadowsocks_libev() {
install_shadowsocks_r() { install_shadowsocks_r() {
echo echo
echo -e "[${green}Info${plain}] ${software[1]} start installing." echo -e "[${green}Info${plain}] ${software[1]} start installing."
echo
cd ${cur_dir} || exit cd ${cur_dir} || exit
tar zxf ${shadowsocks_r_file}.tar.gz tar zxf ${shadowsocks_r_file}.tar.gz
mv ${shadowsocks_r_file}/shadowsocks /usr/local/ mv ${shadowsocks_r_file}/shadowsocks /usr/local/