`shfmt -i 2 -ci`
parent
3a14bbd46f
commit
f0eacd1ca5
|
@ -41,7 +41,6 @@ download_files() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
check_sum() {
|
check_sum() {
|
||||||
(
|
(
|
||||||
cd "${dir_tmp}" || exit
|
cd "${dir_tmp}" || exit
|
||||||
|
|
|
@ -167,7 +167,7 @@ judgment_parameters() {
|
||||||
|
|
||||||
install_software() {
|
install_software() {
|
||||||
COMPONENT="$1"
|
COMPONENT="$1"
|
||||||
command -v "$COMPONENT" > /dev/null 2>&1 && return
|
command -v "$COMPONENT" >/dev/null 2>&1 && return
|
||||||
if ${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT"; then
|
if ${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT"; then
|
||||||
echo "info: $COMPONENT is installed."
|
echo "info: $COMPONENT is installed."
|
||||||
else
|
else
|
||||||
|
@ -309,7 +309,7 @@ install_v2ray() {
|
||||||
# Install V2Ray configuration file to $JSON_PATH
|
# Install V2Ray configuration file to $JSON_PATH
|
||||||
if [[ -z "$JSONS_PATH" ]] && [[ ! -d "$JSON_PATH" ]]; then
|
if [[ -z "$JSONS_PATH" ]] && [[ ! -d "$JSON_PATH" ]]; then
|
||||||
install -d "$JSON_PATH"
|
install -d "$JSON_PATH"
|
||||||
echo "{}" > "${JSON_PATH}/config.json"
|
echo "{}" >"${JSON_PATH}/config.json"
|
||||||
CONFIG_NEW='1'
|
CONFIG_NEW='1'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ install_v2ray() {
|
||||||
if [[ -n "$JSONS_PATH" ]] && [[ ! -d "$JSONS_PATH" ]]; then
|
if [[ -n "$JSONS_PATH" ]] && [[ ! -d "$JSONS_PATH" ]]; then
|
||||||
install -d "$JSONS_PATH"
|
install -d "$JSONS_PATH"
|
||||||
for BASE in 00_log 01_api 02_dns 03_routing 04_policy 05_inbounds 06_outbounds 07_transport 08_stats 09_reverse; do
|
for BASE in 00_log 01_api 02_dns 03_routing 04_policy 05_inbounds 06_outbounds 07_transport 08_stats 09_reverse; do
|
||||||
echo '{}' > "${JSONS_PATH}$BASE.json"
|
echo '{}' >"${JSONS_PATH}$BASE.json"
|
||||||
done
|
done
|
||||||
CONFDIR='1'
|
CONFDIR='1'
|
||||||
fi
|
fi
|
||||||
|
@ -347,9 +347,9 @@ install_startup_service_file() {
|
||||||
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||||
|
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=/usr/local/bin/v2ray -confdir $JSONS_PATH" | \
|
ExecStart=/usr/local/bin/v2ray -confdir $JSONS_PATH" |
|
||||||
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' > \
|
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' > \
|
||||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_multi_conf.conf'
|
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_multi_conf.conf'
|
||||||
else
|
else
|
||||||
echo "${red}~~~~~~~~~~~~~~~~ ${green}/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf ${red}~~~~~~~~~~~~~~~~${reset}"
|
echo "${red}~~~~~~~~~~~~~~~~ ${green}/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf ${red}~~~~~~~~~~~~~~~~${reset}"
|
||||||
echo 'info: The following are the actual parameters for the v2ray service startup.'
|
echo 'info: The following are the actual parameters for the v2ray service startup.'
|
||||||
|
@ -358,10 +358,10 @@ tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' > \
|
||||||
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||||
|
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/config.json" | \
|
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/config.json" |
|
||||||
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf'
|
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf'
|
||||||
echo;
|
echo
|
||||||
echo;
|
echo
|
||||||
|
|
||||||
echo "${red}~~~~~~~~~~~~~~~~ ${green}/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf ${red}~~~~~~~~~~~~~~~~${reset}"
|
echo "${red}~~~~~~~~~~~~~~~~ ${green}/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf ${red}~~~~~~~~~~~~~~~~${reset}"
|
||||||
echo 'info: The following are the actual parameters for the v2ray service startup.'
|
echo 'info: The following are the actual parameters for the v2ray service startup.'
|
||||||
|
@ -370,10 +370,10 @@ tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf'
|
||||||
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||||
|
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/%i.json" | \
|
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/%i.json" |
|
||||||
tee '/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
|
tee '/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
|
||||||
echo;
|
echo
|
||||||
echo;
|
echo
|
||||||
fi
|
fi
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
SYSTEMD='1'
|
SYSTEMD='1'
|
||||||
|
|
Loading…
Reference in New Issue