Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: The judgment has been tested #22

Merged
1 commit merged into from
Jul 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions install-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,11 @@ install_startup_service_file() {

start_v2ray() {
if [[ -f '/etc/systemd/system/v2ray.service' ]]; then
systemctl start v2ray
if [[ -z "$V2RAY_CUSTOMIZE" ]]; then
systemctl start v2ray
else
systemctl start "$V2RAY_CUSTOMIZE"
fi
fi
if [[ "$?" -ne 0 ]]; then
echo 'error: Failed to start V2Ray service.'
Expand All @@ -388,8 +392,11 @@ start_v2ray() {
}

stop_v2ray() {
if [[ -f '/etc/systemd/system/v2ray.service' ]]; then
V2RAY_CUSTOMIZE="$(systemctl list-units | grep 'v2ray@' | awk -F ' ' '{print $1}')"
if [[ -z "$V2RAY_CUSTOMIZE" ]]; then
systemctl stop v2ray
else
systemctl stop "$V2RAY_CUSTOMIZE"
fi
if [[ "$?" -ne '0' ]]; then
echo 'error: Stopping the V2Ray service failed.'
Expand Down