mirror of https://github.com/XTLS/Xray-install
Alpine Linux: Replace raw.githubusercontent.com with github.com/xxx/raw (#89)
parent
3292b9eeae
commit
0529a022f9
|
@ -13,7 +13,7 @@ apk add curl
|
||||||
#### Download Installation Script
|
#### Download Installation Script
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh
|
curl -O https://github.com/XTLS/Xray-install/raw/main/alpinelinux/install-release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Run Installation Script
|
#### Run Installation Script
|
||||||
|
|
|
@ -13,7 +13,7 @@ apk add curl
|
||||||
#### 下载安装脚本
|
#### 下载安装脚本
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh
|
curl -O https://github.com/XTLS/Xray-install/raw/main/alpinelinux/install-release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 运行安装脚本
|
#### 运行安装脚本
|
||||||
|
|
|
@ -13,7 +13,7 @@ apk add curl
|
||||||
#### 下載安裝腳本
|
#### 下載安裝腳本
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh
|
curl -O https://github.com/XTLS/Xray-install/raw/main/alpinelinux/install-release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 執行安裝腳本
|
#### 執行安裝腳本
|
||||||
|
|
|
@ -165,7 +165,7 @@ install_startup_service_file() {
|
||||||
OPENRC='0'
|
OPENRC='0'
|
||||||
if [ ! -f '/etc/init.d/xray' ]; then
|
if [ ! -f '/etc/init.d/xray' ]; then
|
||||||
mkdir "${TMP_DIRECTORY}init.d/"
|
mkdir "${TMP_DIRECTORY}init.d/"
|
||||||
if ! curl -f -L -o "${TMP_DIRECTORY}init.d/xray" https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/init.d/xray -sS; then
|
if ! curl -f -L -o "${TMP_DIRECTORY}init.d/xray" https://github.com/XTLS/Xray-install/raw/main/alpinelinux/init.d/xray -sS; then
|
||||||
echo 'error: Failed to start service file download! Please check your network or try again.'
|
echo 'error: Failed to start service file download! Please check your network or try again.'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# https://github.com/XTLS/Xray-install
|
# https://github.com/XTLS/Xray-install
|
||||||
|
|
||||||
# The URL of the script is:
|
# The URL of the script is:
|
||||||
# https://raw.githubusercontent.com/XTLS/Xray-install/main/install-release.sh
|
# https://github.com/XTLS/Xray-install/raw/main/install-release.sh
|
||||||
|
|
||||||
# If the script executes incorrectly, go to:
|
# If the script executes incorrectly, go to:
|
||||||
# https://github.com/XTLS/Xray-install/issues
|
# https://github.com/XTLS/Xray-install/issues
|
||||||
|
@ -131,55 +131,55 @@ identify_the_operating_system_and_architecture() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
'i386' | 'i686')
|
'i386' | 'i686')
|
||||||
MACHINE='32'
|
MACHINE='32'
|
||||||
;;
|
;;
|
||||||
'amd64' | 'x86_64')
|
'amd64' | 'x86_64')
|
||||||
MACHINE='64'
|
MACHINE='64'
|
||||||
;;
|
;;
|
||||||
'armv5tel')
|
'armv5tel')
|
||||||
MACHINE='arm32-v5'
|
MACHINE='arm32-v5'
|
||||||
;;
|
;;
|
||||||
'armv6l')
|
'armv6l')
|
||||||
MACHINE='arm32-v6'
|
MACHINE='arm32-v6'
|
||||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||||
;;
|
;;
|
||||||
'armv7' | 'armv7l')
|
'armv7' | 'armv7l')
|
||||||
MACHINE='arm32-v7a'
|
MACHINE='arm32-v7a'
|
||||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||||
;;
|
;;
|
||||||
'armv8' | 'aarch64')
|
'armv8' | 'aarch64')
|
||||||
MACHINE='arm64-v8a'
|
MACHINE='arm64-v8a'
|
||||||
;;
|
;;
|
||||||
'mips')
|
'mips')
|
||||||
MACHINE='mips32'
|
MACHINE='mips32'
|
||||||
;;
|
;;
|
||||||
'mipsle')
|
'mipsle')
|
||||||
MACHINE='mips32le'
|
MACHINE='mips32le'
|
||||||
;;
|
;;
|
||||||
'mips64')
|
'mips64')
|
||||||
MACHINE='mips64'
|
MACHINE='mips64'
|
||||||
lscpu | grep -q "Little Endian" && MACHINE='mips64le'
|
lscpu | grep -q "Little Endian" && MACHINE='mips64le'
|
||||||
;;
|
;;
|
||||||
'mips64le')
|
'mips64le')
|
||||||
MACHINE='mips64le'
|
MACHINE='mips64le'
|
||||||
;;
|
;;
|
||||||
'ppc64')
|
'ppc64')
|
||||||
MACHINE='ppc64'
|
MACHINE='ppc64'
|
||||||
;;
|
;;
|
||||||
'ppc64le')
|
'ppc64le')
|
||||||
MACHINE='ppc64le'
|
MACHINE='ppc64le'
|
||||||
;;
|
;;
|
||||||
'riscv64')
|
'riscv64')
|
||||||
MACHINE='riscv64'
|
MACHINE='riscv64'
|
||||||
;;
|
;;
|
||||||
's390x')
|
's390x')
|
||||||
MACHINE='s390x'
|
MACHINE='s390x'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "error: The architecture is not supported."
|
echo "error: The architecture is not supported."
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [[ ! -f '/etc/os-release' ]]; then
|
if [[ ! -f '/etc/os-release' ]]; then
|
||||||
echo "error: Don't use outdated Linux distributions."
|
echo "error: Don't use outdated Linux distributions."
|
||||||
|
@ -215,7 +215,7 @@ identify_the_operating_system_and_architecture() {
|
||||||
PACKAGE_MANAGEMENT_INSTALL='pacman -Syy --noconfirm'
|
PACKAGE_MANAGEMENT_INSTALL='pacman -Syy --noconfirm'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='pacman -Rsn'
|
PACKAGE_MANAGEMENT_REMOVE='pacman -Rsn'
|
||||||
package_provide_tput='ncurses'
|
package_provide_tput='ncurses'
|
||||||
elif [[ "$(type -P emerge)" ]]; then
|
elif [[ "$(type -P emerge)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_INSTALL='emerge -qv'
|
PACKAGE_MANAGEMENT_INSTALL='emerge -qv'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='emerge -Cv'
|
PACKAGE_MANAGEMENT_REMOVE='emerge -Cv'
|
||||||
package_provide_tput='ncurses'
|
package_provide_tput='ncurses'
|
||||||
|
@ -231,99 +231,99 @@ judgment_parameters() {
|
||||||
local temp_version='0'
|
local temp_version='0'
|
||||||
while [[ "$#" -gt '0' ]]; do
|
while [[ "$#" -gt '0' ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'install')
|
'install')
|
||||||
INSTALL='1'
|
INSTALL='1'
|
||||||
;;
|
;;
|
||||||
'install-geodata')
|
'install-geodata')
|
||||||
INSTALL_GEODATA='1'
|
INSTALL_GEODATA='1'
|
||||||
;;
|
;;
|
||||||
'remove')
|
'remove')
|
||||||
REMOVE='1'
|
REMOVE='1'
|
||||||
;;
|
;;
|
||||||
'help')
|
'help')
|
||||||
HELP='1'
|
HELP='1'
|
||||||
;;
|
;;
|
||||||
'check')
|
'check')
|
||||||
CHECK='1'
|
CHECK='1'
|
||||||
;;
|
;;
|
||||||
'--without-geodata')
|
'--without-geodata')
|
||||||
NO_GEODATA='1'
|
NO_GEODATA='1'
|
||||||
;;
|
;;
|
||||||
'--without-logfiles')
|
'--without-logfiles')
|
||||||
NO_LOGFILES='1'
|
NO_LOGFILES='1'
|
||||||
;;
|
;;
|
||||||
'--purge')
|
'--purge')
|
||||||
PURGE='1'
|
PURGE='1'
|
||||||
;;
|
;;
|
||||||
'--version')
|
'--version')
|
||||||
if [[ -z "$2" ]]; then
|
if [[ -z "$2" ]]; then
|
||||||
echo "error: Please specify the correct version."
|
echo "error: Please specify the correct version."
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
temp_version='1'
|
|
||||||
SPECIFIED_VERSION="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
'-f' | '--force')
|
|
||||||
FORCE='1'
|
|
||||||
;;
|
|
||||||
'--beta')
|
|
||||||
BETA='1'
|
|
||||||
;;
|
|
||||||
'-l' | '--local')
|
|
||||||
local_install='1'
|
|
||||||
if [[ -z "$2" ]]; then
|
|
||||||
echo "error: Please specify the correct local file."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
LOCAL_FILE="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
'-p' | '--proxy')
|
|
||||||
if [[ -z "$2" ]]; then
|
|
||||||
echo "error: Please specify the proxy server address."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
PROXY="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
'-u' | '--install-user')
|
|
||||||
if [[ -z "$2" ]]; then
|
|
||||||
echo "error: Please specify the install user.}"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
INSTALL_USER="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
'--reinstall')
|
|
||||||
REINSTALL='1'
|
|
||||||
;;
|
|
||||||
'--no-update-service')
|
|
||||||
N_UP_SERVICE='1'
|
|
||||||
;;
|
|
||||||
'--logrotate')
|
|
||||||
if ! grep -qE '\b([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\b' <<< "$2";then
|
|
||||||
echo "error: Wrong format of time, it should be in the format of 12:34:56, under 10:00:00 should be start with 0, e.g. 01:23:45."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
LOGROTATE='1'
|
|
||||||
LOGROTATE_TIME="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "$0: unknown option -- -"
|
|
||||||
return 1
|
return 1
|
||||||
;;
|
fi
|
||||||
|
temp_version='1'
|
||||||
|
SPECIFIED_VERSION="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
'-f' | '--force')
|
||||||
|
FORCE='1'
|
||||||
|
;;
|
||||||
|
'--beta')
|
||||||
|
BETA='1'
|
||||||
|
;;
|
||||||
|
'-l' | '--local')
|
||||||
|
local_install='1'
|
||||||
|
if [[ -z "$2" ]]; then
|
||||||
|
echo "error: Please specify the correct local file."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
LOCAL_FILE="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
'-p' | '--proxy')
|
||||||
|
if [[ -z "$2" ]]; then
|
||||||
|
echo "error: Please specify the proxy server address."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
PROXY="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
'-u' | '--install-user')
|
||||||
|
if [[ -z "$2" ]]; then
|
||||||
|
echo "error: Please specify the install user.}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
INSTALL_USER="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
'--reinstall')
|
||||||
|
REINSTALL='1'
|
||||||
|
;;
|
||||||
|
'--no-update-service')
|
||||||
|
N_UP_SERVICE='1'
|
||||||
|
;;
|
||||||
|
'--logrotate')
|
||||||
|
if ! grep -qE '\b([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\b' <<<"$2"; then
|
||||||
|
echo "error: Wrong format of time, it should be in the format of 12:34:56, under 10:00:00 should be start with 0, e.g. 01:23:45."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
LOGROTATE='1'
|
||||||
|
LOGROTATE_TIME="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$0: unknown option -- -"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
if ((INSTALL+INSTALL_GEODATA+HELP+CHECK+REMOVE==0)); then
|
if ((INSTALL + INSTALL_GEODATA + HELP + CHECK + REMOVE == 0)); then
|
||||||
INSTALL='1'
|
INSTALL='1'
|
||||||
elif ((INSTALL+INSTALL_GEODATA+HELP+CHECK+REMOVE>1)); then
|
elif ((INSTALL + INSTALL_GEODATA + HELP + CHECK + REMOVE > 1)); then
|
||||||
echo 'You can only choose one action.'
|
echo 'You can only choose one action.'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [[ "$INSTALL" -eq '1' ]] && ((temp_version+local_install+REINSTALL+BETA>1)); then
|
if [[ "$INSTALL" -eq '1' ]] && ((temp_version + local_install + REINSTALL + BETA > 1)); then
|
||||||
echo "--version,--reinstall,--beta and --local can't be used together."
|
echo "--version,--reinstall,--beta and --local can't be used together."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -340,7 +340,7 @@ check_install_user() {
|
||||||
INSTALL_USER='nobody'
|
INSTALL_USER='nobody'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if ! id "$INSTALL_USER" > /dev/null 2>&1; then
|
if ! id "$INSTALL_USER" >/dev/null 2>&1; then
|
||||||
echo "the user '$INSTALL_USER' is not effective"
|
echo "the user '$INSTALL_USER' is not effective"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -351,7 +351,7 @@ check_install_user() {
|
||||||
install_software() {
|
install_software() {
|
||||||
package_name="$1"
|
package_name="$1"
|
||||||
file_to_detect="$2"
|
file_to_detect="$2"
|
||||||
type -P "$file_to_detect" > /dev/null 2>&1 && return
|
type -P "$file_to_detect" >/dev/null 2>&1 && return
|
||||||
if ${PACKAGE_MANAGEMENT_INSTALL} "$package_name" >/dev/null 2>&1; then
|
if ${PACKAGE_MANAGEMENT_INSTALL} "$package_name" >/dev/null 2>&1; then
|
||||||
echo "info: $package_name is installed."
|
echo "info: $package_name is installed."
|
||||||
else
|
else
|
||||||
|
@ -495,7 +495,7 @@ install_xray() {
|
||||||
# shellcheck disable=SC2153
|
# shellcheck disable=SC2153
|
||||||
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
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ install_xray() {
|
||||||
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
|
||||||
|
@ -532,7 +532,7 @@ install_startup_service_file() {
|
||||||
temp_AmbientCapabilities="#${temp_AmbientCapabilities}"
|
temp_AmbientCapabilities="#${temp_AmbientCapabilities}"
|
||||||
temp_NoNewPrivileges="#${temp_NoNewPrivileges}"
|
temp_NoNewPrivileges="#${temp_NoNewPrivileges}"
|
||||||
fi
|
fi
|
||||||
cat > /etc/systemd/system/xray.service << EOF
|
cat >/etc/systemd/system/xray.service <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Xray Service
|
Description=Xray Service
|
||||||
Documentation=https://github.com/xtls
|
Documentation=https://github.com/xtls
|
||||||
|
@ -552,7 +552,7 @@ LimitNOFILE=1000000
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
cat > /etc/systemd/system/xray@.service <<EOF
|
cat >/etc/systemd/system/xray@.service <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Xray Service
|
Description=Xray Service
|
||||||
Documentation=https://github.com/xtls
|
Documentation=https://github.com/xtls
|
||||||
|
@ -643,9 +643,9 @@ stop_xray() {
|
||||||
install_with_logrotate() {
|
install_with_logrotate() {
|
||||||
install_software 'logrotate' 'logrotate'
|
install_software 'logrotate' 'logrotate'
|
||||||
if [[ -z "$LOGROTATE_TIME" ]]; then
|
if [[ -z "$LOGROTATE_TIME" ]]; then
|
||||||
LOGROTATE_TIME="00:00:00"
|
LOGROTATE_TIME="00:00:00"
|
||||||
fi
|
fi
|
||||||
cat <<EOF > /etc/systemd/system/logrotate@.service
|
cat <<EOF >/etc/systemd/system/logrotate@.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Rotate log files
|
Description=Rotate log files
|
||||||
Documentation=man:logrotate(8)
|
Documentation=man:logrotate(8)
|
||||||
|
@ -654,7 +654,7 @@ Documentation=man:logrotate(8)
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/sbin/logrotate /etc/logrotate.d/%i
|
ExecStart=/usr/sbin/logrotate /etc/logrotate.d/%i
|
||||||
EOF
|
EOF
|
||||||
cat <<EOF > /etc/systemd/system/logrotate@.timer
|
cat <<EOF >/etc/systemd/system/logrotate@.timer
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Run logrotate for %i logs
|
Description=Run logrotate for %i logs
|
||||||
|
|
||||||
|
@ -666,10 +666,10 @@ Persistent=true
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
EOF
|
EOF
|
||||||
if [[ ! -d '/etc/logrotate.d/' ]]; then
|
if [[ ! -d '/etc/logrotate.d/' ]]; then
|
||||||
install -d -m 700 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /etc/logrotate.d/
|
install -d -m 700 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /etc/logrotate.d/
|
||||||
LOGROTATE_DIR='1'
|
LOGROTATE_DIR='1'
|
||||||
fi
|
fi
|
||||||
cat << EOF > /etc/logrotate.d/xray
|
cat <<EOF >/etc/logrotate.d/xray
|
||||||
/var/log/xray/*.log {
|
/var/log/xray/*.log {
|
||||||
daily
|
daily
|
||||||
missingok
|
missingok
|
||||||
|
@ -711,7 +711,7 @@ install_geodata() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
cd - > /dev/null || exit 1
|
cd - >/dev/null || exit 1
|
||||||
install -d "$DAT_PATH"
|
install -d "$DAT_PATH"
|
||||||
install -m 644 "${dir_tmp}"/${file_dlc} "${DAT_PATH}"/${file_site}
|
install -m 644 "${dir_tmp}"/${file_dlc} "${DAT_PATH}"/${file_site}
|
||||||
install -m 644 "${dir_tmp}"/${file_ip} "${DAT_PATH}"/${file_ip}
|
install -m 644 "${dir_tmp}"/${file_ip} "${DAT_PATH}"/${file_ip}
|
||||||
|
@ -751,8 +751,8 @@ remove_xray() {
|
||||||
[[ -f '/etc/systemd/system/logrotate@.timer' ]] && delete_files+=('/etc/systemd/system/logrotate@.timer')
|
[[ -f '/etc/systemd/system/logrotate@.timer' ]] && delete_files+=('/etc/systemd/system/logrotate@.timer')
|
||||||
fi
|
fi
|
||||||
systemctl disable xray
|
systemctl disable xray
|
||||||
if [[ -f '/etc/systemd/system/logrotate@.timer' ]] ; then
|
if [[ -f '/etc/systemd/system/logrotate@.timer' ]]; then
|
||||||
if ! systemctl stop logrotate@xray.timer && systemctl disable logrotate@xray.timer ; then
|
if ! systemctl stop logrotate@xray.timer && systemctl disable logrotate@xray.timer; then
|
||||||
echo 'error: Stopping and disabling the logrotate service failed.'
|
echo 'error: Stopping and disabling the logrotate service failed.'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -762,8 +762,7 @@ remove_xray() {
|
||||||
echo 'error: Failed to remove Xray.'
|
echo 'error: Failed to remove Xray.'
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
for i in "${!delete_files[@]}"
|
for i in "${!delete_files[@]}"; do
|
||||||
do
|
|
||||||
echo "removed: ${delete_files[$i]}"
|
echo "removed: ${delete_files[$i]}"
|
||||||
done
|
done
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
@ -934,7 +933,7 @@ main() {
|
||||||
echo 'installed: /etc/systemd/system/logrotate@.service'
|
echo 'installed: /etc/systemd/system/logrotate@.service'
|
||||||
echo 'installed: /etc/systemd/system/logrotate@.timer'
|
echo 'installed: /etc/systemd/system/logrotate@.timer'
|
||||||
if [[ "$LOGROTATE_DIR" -eq '1' ]]; then
|
if [[ "$LOGROTATE_DIR" -eq '1' ]]; then
|
||||||
echo 'installed: /etc/logrotate.d/'
|
echo 'installed: /etc/logrotate.d/'
|
||||||
fi
|
fi
|
||||||
echo 'installed: /etc/logrotate.d/xray'
|
echo 'installed: /etc/logrotate.d/xray'
|
||||||
systemctl start logrotate@xray.timer
|
systemctl start logrotate@xray.timer
|
||||||
|
|
Loading…
Reference in New Issue