mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-22 22:32:41 +00:00
feat: Add etckeeper compatibility
This commit is contained in:
parent
0ea8b5352a
commit
837dea04e8
1 changed files with 14 additions and 0 deletions
14
install.sh
14
install.sh
|
|
@ -220,6 +220,20 @@ install_x-ui() {
|
|||
chmod +x /usr/bin/x-ui
|
||||
config_after_install
|
||||
|
||||
# Etckeeper compatibility
|
||||
if [ -d "/etc/.git" ]; then
|
||||
if [ -f "/etc/.gitignore" ]; then
|
||||
if ! grep -q "x-ui/x-ui.db" "/etc/.gitignore"; then
|
||||
echo "" >> "/etc/.gitignore"
|
||||
echo "x-ui/x-ui.db" >> "/etc/.gitignore"
|
||||
echo -e "${green}Added x-ui.db to /etc/.gitignore for etckeeper${plain}"
|
||||
fi
|
||||
else
|
||||
echo "x-ui/x-ui.db" > "/etc/.gitignore"
|
||||
echo -e "${green}Created /etc/.gitignore and added x-ui.db for etckeeper${plain}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $release == "alpine" ]]; then
|
||||
wget --inet4-only -O /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc
|
||||
if [[ $? -ne 0 ]]; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue