fix5: fix function start_v2ray

pull/108/head
xiagw 2020-09-17 17:49:20 +07:00
parent 684560061f
commit ea2fc97a31
No known key found for this signature in database
GPG Key ID: AA79D99901C34E05
1 changed files with 4 additions and 8 deletions

View File

@ -388,17 +388,13 @@ install_startup_service_file() {
start_v2ray() {
if [[ -f '/etc/systemd/system/v2ray.service' ]]; then
if [[ -z "$V2RAY_CUSTOMIZE" ]]; then
systemctl start v2ray
if systemctl start "${V2RAY_CUSTOMIZE:-v2ray}"; then
echo 'info: Start the V2Ray service.'
else
systemctl start "$V2RAY_CUSTOMIZE"
echo 'error: Failed to start V2Ray service.'
exit 1
fi
fi
if [[ "$?" -ne 0 ]]; then
echo 'error: Failed to start V2Ray service.'
exit 1
fi
echo 'info: Start the V2Ray service.'
}
stop_v2ray() {