Update xlxd.sh

This commit is contained in:
Script Proyect by HP3ICC 2024-05-20 03:54:46 +00:00
parent 49a6280bc0
commit 1c6c864181
1 changed files with 39 additions and 20 deletions

View File

@ -165,12 +165,28 @@ then
#echo "found file"
fi
for file in "/usr/local/bin/"xlxd*; do
# Verificar si el archivo existe y es un archivo regular
if [ -f "$file" ]; then
rm "$file"
fi
done
for file in "/usr/local/etc/"xlxd*; do
# Verificar si el archivo existe y es un archivo regular
if [ -f "$file" ]; then
rm "$file"
fi
done
#######################
#INSTALL
echo "------------------------------------------------------------------------------"
cd /opt
#git clone https://github.com/LX3JL/xlxd.git
git clone https://github.com/iu5jae/xlxd.git
git clone https://github.com/LX3JL/xlxd.git
#git clone https://github.com/iu5jae/xlxd.git
#git clone https://github.com/n7tae/new-xlxd.git xlxd
#cd /opt/xlxd/
#mv dashboard.xlx dashboard
#mv dashboard.xrf dashboard2
cd /opt/xlxd/src/
echo "------------------------------------------------------------------------------"
@ -209,12 +225,25 @@ chown -R www-data:www-data /opt/xlxd/dashboard/
chown -R www-data:www-data /opt/xlxd/dashboard2/
###########
#sudo chmod +x /etc/init.d/xlxd
sudo chmod +x /opt/xlxd/ambed/run
sudo chmod +r /var/log/messages
sudo chmod -R +x /opt/xlxd/*
sudo chmod -R 777 /var/log/*
#make clean
#make
#make install
#####################################################################################
cat > /lib/systemd/system/rebooter-xlxd.service <<- "EOF"
[Unit]
Description=Rebooter-xlxd
[Service]
User=root
ExecStart=/usr/local/bin/rebooter-xlxd.sh
[Install]
WantedBy=default.target
EOF
#
#######################################
sudo cat > /usr/local/bin/rebooter-xlxd.sh <<- "EOF"
#!/bin/bash
#sleep 30
@ -229,22 +258,7 @@ done
EOF
chmod +x /usr/local/bin/rebooter-xlxd.sh
######################################
#
cat > /lib/systemd/system/rebooter-xlxd.service <<- "EOF"
[Unit]
Description=Rebooter-xlxd
[Service]
User=root
ExecStart=/usr/local/bin/rebooter-xlxd.sh
[Install]
WantedBy=default.target
EOF
#
#######################################
sudo systemctl daemon-reload
wdp=/opt/wdp10
wsn0=$(grep "Web-Dashboar-name:" $wdp | grep -oP 'Web-Dashboar-name:\s*\K.*')
if [ -f "/etc/nginx/sites-enabled/$wsn0" ]; then
@ -262,7 +276,12 @@ fi
if [ -f "/etc/init.d/xlxd" ]; then
rm /etc/init.d/xlxd
fi
if [ -f "/etc/systemd/system/xlxd.service" ]; then
rm /etc/systemd/system/xlxd.service
fi
if [ -f "/lib/systemd/system/xlxd.service" ]; then
rm /lib/systemd/system/xlxd.service
fi
sudo update-rc.d -f xlxd remove
#sudo reboot
echo "Finalizado: $SCRIPT_NAME" >> /opt/curl.txt