File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,11 @@ install_startup_service_file() {
378
378
379
379
start_v2ray () {
380
380
if [[ -f ' /etc/systemd/system/v2ray.service' ]]; then
381
- systemctl start v2ray
381
+ if [[ -z " $V2RAY_CUSTOMIZE " ]]; then
382
+ systemctl start v2ray
383
+ else
384
+ systemctl start " $V2RAY_CUSTOMIZE "
385
+ fi
382
386
fi
383
387
if [[ " $? " -ne 0 ]]; then
384
388
echo ' error: Failed to start V2Ray service.'
@@ -388,8 +392,11 @@ start_v2ray() {
388
392
}
389
393
390
394
stop_v2ray () {
391
- if [[ -f ' /etc/systemd/system/v2ray.service' ]]; then
395
+ V2RAY_CUSTOMIZE=" $( systemctl list-units | grep ' v2ray@' | awk -F ' ' ' {print $1}' ) "
396
+ if [[ -z " $V2RAY_CUSTOMIZE " ]]; then
392
397
systemctl stop v2ray
398
+ else
399
+ systemctl stop " $V2RAY_CUSTOMIZE "
393
400
fi
394
401
if [[ " $? " -ne ' 0' ]]; then
395
402
echo ' error: Stopping the V2Ray service failed.'
You can’t perform that action at this time.
0 commit comments