Skip to content

Commit

Permalink
do_uninstall_ssr_action in script.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Jun 21, 2020
1 parent 943a4f1 commit a28f009
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions install/ssrn-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -529,29 +529,33 @@ function install_ssr_service() {
fi
}

function do_uninstall_ssr_action() {
${service_stub} status > /dev/null 2>&1
if [ $? -eq 0 ]; then
${service_stub} stop
fi
if check_sys packageManager yum; then
chkconfig --del ${service_name}
elif check_sys packageManager apt; then
update-rc.d -f ${service_name} remove
fi

systemctl stop ${service_name}.service

rm -rf ${config_dir}
rm -f ${service_stub}
rm -f ${target_dir}/${bin_name}
rm -f ${service_dir}/${service_name}.service
echo "ShadowsocksR uninstall success!"
}

# Uninstall ShadowsocksR
function uninstall_shadowsocksr() {
printf "Are you sure uninstall ${proj_name}? (y/n)\n"
read -p "(Default: n):" answer
[ -z ${answer} ] && answer="n"
if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
${service_stub} status > /dev/null 2>&1
if [ $? -eq 0 ]; then
${service_stub} stop
fi
if check_sys packageManager yum; then
chkconfig --del ${service_name}
elif check_sys packageManager apt; then
update-rc.d -f ${service_name} remove
fi

systemctl stop ${service_name}.service

rm -rf ${config_dir}
rm -f ${service_stub}
rm -f ${target_dir}/${bin_name}
rm -f ${service_dir}/${service_name}.service
echo "ShadowsocksR uninstall success!"
do_uninstall_ssr_action
else
echo
echo "uninstall cancelled, nothing to do..."
Expand All @@ -573,6 +577,8 @@ function install_shadowsocksr() {

install_build_tools

do_uninstall_ssr_action

build_ssr_native

write_ssr_config
Expand Down

0 comments on commit a28f009

Please sign in to comment.