From 1c6c864181d09668a568b1dffcde57cd2a29be85 Mon Sep 17 00:00:00 2001 From: Script Proyect by HP3ICC Date: Mon, 20 May 2024 03:54:46 +0000 Subject: [PATCH] Update xlxd.sh --- install/xlxd.sh | 59 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/install/xlxd.sh b/install/xlxd.sh index ac4011d..ae6066a 100644 --- a/install/xlxd.sh +++ b/install/xlxd.sh @@ -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