Skip to content

Commit

Permalink
Introduce systemd_cat_config function
Browse files Browse the repository at this point in the history
  • Loading branch information
IceCodeNew committed Oct 2, 2020
1 parent ccd02ac commit 32d5d6e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions install-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ curl() {
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 "$@"
}

systemd_cat_config() {
if systemd-analyze --help | grep -qw 'cat-config'; then
systemd-analyze cat-config "$@"
else
echo "${red}warning: ${green}The systemd version on the current operating system is too low."
echo "${red}warning: ${green}Please consider to upgrade the systemd or the operating system.${reset}"
fi
}

check_if_running_as_root() {
# If you want to run as another user, please modify $UID to be owned by this user
if [[ "$UID" -ne '0' ]]; then
Expand Down Expand Up @@ -393,12 +402,12 @@ ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/%i.json" > \
echo "info: Systemd service files have been installed successfully!"
echo "${red}warning: ${green}The following are the actual parameters for the v2ray service startup."
echo "${red}warning: ${green}Please make sure the configuration file path is correctly set.${reset}"
systemd-analyze cat-config /etc/systemd/system/v2ray.service
systemd_cat_config /etc/systemd/system/v2ray.service
# shellcheck disable=SC2154
if [[ x"${check_all_service_files:0:1}" = x'y' ]]; then
echo
echo
systemd-analyze cat-config /etc/systemd/system/[email protected]
systemd_cat_config /etc/systemd/system/[email protected]
fi
systemctl daemon-reload
SYSTEMD='1'
Expand Down

0 comments on commit 32d5d6e

Please sign in to comment.