-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: no systemd detected * format * fix ci for OpenSUSE * drop ci for OpenSUSE since the newer image does not come with the systemd; and the EOL OSes need extra hack to get the script work
- Loading branch information
1 parent
b4035a8
commit 5b7125e
Showing
2 changed files
with
6 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,7 +217,7 @@ install_software() { | |
} | ||
|
||
get_current_version() { | ||
if /usr/local/bin/v2ray -version >/dev/null 2>&1;then | ||
if /usr/local/bin/v2ray -version > /dev/null 2>&1; then | ||
VERSION="$(/usr/local/bin/v2ray -version | awk 'NR==1 {print $2}')" | ||
else | ||
VERSION="$(/usr/local/bin/v2ray version | awk 'NR==1 {print $2}')" | ||
|
@@ -380,7 +380,7 @@ install_v2ray() { | |
|
||
install_startup_service_file() { | ||
get_current_version | ||
if [[ "$(echo "${CURRENT_VERSION#v}" | sed 's/-.*//' | awk -F'.' '{print $1}')" -gt "4" ]];then | ||
if [[ "$(echo "${CURRENT_VERSION#v}" | sed 's/-.*//' | awk -F'.' '{print $1}')" -gt "4" ]]; then | ||
START_COMMAND="/usr/local/bin/v2ray run" | ||
else | ||
START_COMMAND="/usr/local/bin/v2ray" | ||
|
@@ -397,23 +397,20 @@ install_startup_service_file() { | |
[Service] | ||
ExecStart= | ||
ExecStart=${START_COMMAND} -confdir $JSONS_PATH" | | ||
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' > \ | ||
'/etc/systemd/system/[email protected]/10-donot_touch_multi_conf.conf' | ||
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' > '/etc/systemd/system/[email protected]/10-donot_touch_multi_conf.conf' | ||
else | ||
"rm" -f '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' \ | ||
'/etc/systemd/system/[email protected]/10-donot_touch_multi_conf.conf' | ||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there. | ||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html | ||
[Service] | ||
ExecStart= | ||
ExecStart=${START_COMMAND} -config ${JSON_PATH}/config.json" > \ | ||
'/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf' | ||
ExecStart=${START_COMMAND} -config ${JSON_PATH}/config.json" > '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf' | ||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there. | ||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html | ||
[Service] | ||
ExecStart= | ||
ExecStart=${START_COMMAND} -config ${JSON_PATH}/%i.json" > \ | ||
'/etc/systemd/system/[email protected]/10-donot_touch_single_conf.conf' | ||
ExecStart=${START_COMMAND} -config ${JSON_PATH}/%i.json" > '/etc/systemd/system/[email protected]/10-donot_touch_single_conf.conf' | ||
fi | ||
echo "info: Systemd service files have been installed successfully!" | ||
echo "${red}warning: ${green}The following are the actual parameters for the v2ray service startup." | ||
|