mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-01-11 16:22:45 +00:00
Set log folder variable to /var/log/3x-ui (#3599)
* Set log folder variable to /var/log/3x-ui * Set log folder as x-ui and create the log folder * Create the log folder in install and update scripts
This commit is contained in:
parent
260eedf8c4
commit
c061337ce7
4 changed files with 5 additions and 2 deletions
|
|
@ -109,7 +109,7 @@ func GetLogFolder() string {
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
return filepath.Join(".", "log")
|
return filepath.Join(".", "log")
|
||||||
}
|
}
|
||||||
return "/var/log"
|
return "/var/log/x-ui"
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyFile(src, dst string) error {
|
func copyFile(src, dst string) error {
|
||||||
|
|
|
||||||
|
|
@ -641,6 +641,7 @@ install_x-ui() {
|
||||||
# Update x-ui cli and se set permission
|
# Update x-ui cli and se set permission
|
||||||
mv -f /usr/bin/x-ui-temp /usr/bin/x-ui
|
mv -f /usr/bin/x-ui-temp /usr/bin/x-ui
|
||||||
chmod +x /usr/bin/x-ui
|
chmod +x /usr/bin/x-ui
|
||||||
|
mkdir -p /var/log/x-ui
|
||||||
config_after_install
|
config_after_install
|
||||||
|
|
||||||
if [[ $release == "alpine" ]]; then
|
if [[ $release == "alpine" ]]; then
|
||||||
|
|
|
||||||
|
|
@ -653,6 +653,7 @@ update_x-ui() {
|
||||||
|
|
||||||
chmod +x /usr/local/x-ui/x-ui.sh >/dev/null 2>&1
|
chmod +x /usr/local/x-ui/x-ui.sh >/dev/null 2>&1
|
||||||
chmod +x /usr/bin/x-ui >/dev/null 2>&1
|
chmod +x /usr/bin/x-ui >/dev/null 2>&1
|
||||||
|
mkdir -p /var/log/x-ui >/dev/null 2>&1
|
||||||
|
|
||||||
echo -e "${green}Changing owner...${plain}"
|
echo -e "${green}Changing owner...${plain}"
|
||||||
chown -R root:root /usr/local/x-ui >/dev/null 2>&1
|
chown -R root:root /usr/local/x-ui >/dev/null 2>&1
|
||||||
|
|
|
||||||
3
x-ui.sh
3
x-ui.sh
|
|
@ -53,7 +53,8 @@ os_version=""
|
||||||
os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.')
|
os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.')
|
||||||
|
|
||||||
# Declare Variables
|
# Declare Variables
|
||||||
log_folder="${XUI_LOG_FOLDER:=/var/log}"
|
log_folder="${XUI_LOG_FOLDER:=/var/log/x-ui}"
|
||||||
|
mkdir -p "${log_folder}"
|
||||||
iplimit_log_path="${log_folder}/3xipl.log"
|
iplimit_log_path="${log_folder}/3xipl.log"
|
||||||
iplimit_banned_log_path="${log_folder}/3xipl-banned.log"
|
iplimit_banned_log_path="${log_folder}/3xipl-banned.log"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue