mirror of https://github.com/XTLS/Xray-install
Changes:
1.Default retention time 2.Check Logrotate after Check User https://github.com/XTLS/Xray-core/discussions/2369#discussioncomment-6554217pull/62/head
parent
4847b9d999
commit
515eace59b
|
@ -626,7 +626,6 @@ stop_xray() {
|
||||||
|
|
||||||
install_with_logrotate() {
|
install_with_logrotate() {
|
||||||
install_software 'logrotate' 'logrotate'
|
install_software 'logrotate' 'logrotate'
|
||||||
check_install_user
|
|
||||||
if [[ -z "$LOGROTATE_TIME" ]]; then
|
if [[ -z "$LOGROTATE_TIME" ]]; then
|
||||||
LOGROTATE_TIME="00:00:00"
|
LOGROTATE_TIME="00:00:00"
|
||||||
fi
|
fi
|
||||||
|
@ -655,20 +654,10 @@ EOF
|
||||||
LOGROTATE_DIR='1'
|
LOGROTATE_DIR='1'
|
||||||
fi
|
fi
|
||||||
cat << EOF > /etc/logrotate.d/xray
|
cat << EOF > /etc/logrotate.d/xray
|
||||||
/var/log/xray/access.log {
|
/var/log/xray/*.log {
|
||||||
daily
|
daily
|
||||||
missingok
|
missingok
|
||||||
rotate 30
|
rotate 7
|
||||||
compress
|
|
||||||
delaycompress
|
|
||||||
notifempty
|
|
||||||
create 0600 $INSTALL_USER_UID $INSTALL_USER_GID
|
|
||||||
}
|
|
||||||
|
|
||||||
/var/log/xray/error.log {
|
|
||||||
daily
|
|
||||||
missingok
|
|
||||||
rotate 30
|
|
||||||
compress
|
compress
|
||||||
delaycompress
|
delaycompress
|
||||||
notifempty
|
notifempty
|
||||||
|
@ -824,10 +813,13 @@ main() {
|
||||||
[[ "$CHECK" -eq '1' ]] && check_update
|
[[ "$CHECK" -eq '1' ]] && check_update
|
||||||
[[ "$REMOVE" -eq '1' ]] && remove_xray
|
[[ "$REMOVE" -eq '1' ]] && remove_xray
|
||||||
[[ "$INSTALL_GEODATA" -eq '1' ]] && install_geodata
|
[[ "$INSTALL_GEODATA" -eq '1' ]] && install_geodata
|
||||||
[[ "$LOGROTATE" -eq '1' ]] && install_with_logrotate
|
|
||||||
# Check if the user is effective
|
# Check if the user is effective
|
||||||
check_install_user
|
check_install_user
|
||||||
|
|
||||||
|
# Check Logrotate after Check User
|
||||||
|
[[ "$LOGROTATE" -eq '1' ]] && install_with_logrotate
|
||||||
|
|
||||||
# Two very important variables
|
# Two very important variables
|
||||||
TMP_DIRECTORY="$(mktemp -d)"
|
TMP_DIRECTORY="$(mktemp -d)"
|
||||||
ZIP_FILE="${TMP_DIRECTORY}/Xray-linux-$MACHINE.zip"
|
ZIP_FILE="${TMP_DIRECTORY}/Xray-linux-$MACHINE.zip"
|
||||||
|
|
Loading…
Reference in New Issue