From 426ec385d494e21f0610320061b90ead51c9c5a0 Mon Sep 17 00:00:00 2001 From: Yuk1n0 <39364985+Yuk1n0@users.noreply.github.com> Date: Sat, 10 Jul 2021 19:40:02 +0800 Subject: [PATCH] Add uninstall_lib functions --- shadowsocks.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/shadowsocks.sh b/shadowsocks.sh index 7b863df..3337c32 100644 --- a/shadowsocks.sh +++ b/shadowsocks.sh @@ -779,6 +779,48 @@ install_shadowsocks() { install_cleanup } +uninstall_libsodium() { + printf "Are you sure uninstall ${red}${libsodium_file}${plain}? [y/n]\n" + read -p "(default: n):" answer + [ -z ${answer} ] && answer="n" + if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then + rm -f /usr/lib64/libsodium.so.23 + rm -f /usr/lib64/libsodium.a + rm -f /usr/lib64/libsodium.la + rm -f /usr/lib64/pkgconfig/libsodium.pc + rm -f /usr/lib64/libsodium.so.23.3.0 + rm -f /usr/lib64/libsodium.so + rm -rf /usr/include/sodium + rm -f /usr/include/sodium.h + ldconfig + echo -e "[${green}Info${plain}] ${libsodium_file} uninstall success" + else + echo + echo -e "[${green}Info${plain}] ${libsodium_file} uninstall cancelled, nothing to do..." + echo + fi +} + +uninstall_mbedtls() { + printf "Are you sure uninstall ${red}${mbedtls_file}${plain}? [y/n]\n" + read -p "(default: n):" answer + [ -z ${answer} ] && answer="n" + if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then + rm -f /usr/lib/libmbedtls.a + rm -f /usr/lib/libmbedtls.so + rm -f /usr/lib/libmbedtls.so.13 + rm -rf /usr/include/mbedtls + rm -f /usr/include/mbedtls/mbedtls_config.h + rm -f /usr/bin/mbedtls_* + ldconfig + echo -e "[${green}Info${plain}] ${mbedtls_file} uninstall success" + else + echo + echo -e "[${green}Info${plain}] ${mbedtls_file} uninstall cancelled, nothing to do..." + echo + fi +} + uninstall_shadowsocks_libev() { printf "Are you sure uninstall ${red}${software[0]}${plain}? [y/n]\n" read -p "(default: n):" answer