`shfmt -i 2 -ci`

pull/116/head
IceCodeNew 2020-09-20 00:35:30 +08:00
parent 3a14bbd46f
commit f0eacd1ca5
2 changed files with 478 additions and 479 deletions

View File

@ -41,7 +41,6 @@ download_files() {
fi
}
check_sum() {
(
cd "${dir_tmp}" || exit

View File

@ -167,7 +167,7 @@ judgment_parameters() {
install_software() {
COMPONENT="$1"
command -v "$COMPONENT" > /dev/null 2>&1 && return
command -v "$COMPONENT" >/dev/null 2>&1 && return
if ${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT"; then
echo "info: $COMPONENT is installed."
else
@ -309,7 +309,7 @@ install_v2ray() {
# Install V2Ray configuration file to $JSON_PATH
if [[ -z "$JSONS_PATH" ]] && [[ ! -d "$JSON_PATH" ]]; then
install -d "$JSON_PATH"
echo "{}" > "${JSON_PATH}/config.json"
echo "{}" >"${JSON_PATH}/config.json"
CONFIG_NEW='1'
fi
@ -317,7 +317,7 @@ install_v2ray() {
if [[ -n "$JSONS_PATH" ]] && [[ ! -d "$JSONS_PATH" ]]; then
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
echo '{}' > "${JSONS_PATH}$BASE.json"
echo '{}' >"${JSONS_PATH}$BASE.json"
done
CONFDIR='1'
fi
@ -347,9 +347,9 @@ install_startup_service_file() {
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
ExecStart=
ExecStart=/usr/local/bin/v2ray -confdir $JSONS_PATH" | \
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'
ExecStart=/usr/local/bin/v2ray -confdir $JSONS_PATH" |
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'
else
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.'
@ -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
ExecStart=
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/config.json" | \
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf'
echo;
echo;
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/config.json" |
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf'
echo
echo
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.'
@ -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
ExecStart=
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/%i.json" | \
tee '/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
echo;
echo;
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/%i.json" |
tee '/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
echo
echo
fi
systemctl daemon-reload
SYSTEMD='1'