Update update.sh

merge-requests/1/head
RaspbianProyect by HP3ICC 2 years ago
parent 6127a62fb0
commit 82d3253070

@ -1,4 +1,47 @@
#!/bin/bash
if [ -f "/opt/extra-1.sh" ]
then
echo "found file"
else
sudo cat > /opt/extra-1.sh <<- "EOF"
######################################################################
# Coloque en este archivo, cualquier instruccion shell adicional que #
# quierre se realice al finalizar la actualizacion. #
######################################################################
EOF
#
fi
if [ -f "/opt/extra-2.sh" ]
then
echo "found file"
else
sudo cat > /opt/extra-2.sh <<- "EOF"
######################################################################
# Coloque en este archivo, cualquier instruccion shell adicional que #
# quierre se realice al finalizar la actualizacion. #
######################################################################
EOF
#
fi
if [ -f "/opt/extra-3.sh" ]
then
echo "found file"
else
sudo cat > /opt/extra-3.sh <<- "EOF"
######################################################################
# Coloque en este archivo, cualquier instruccion shell adicional que #
# quierre se realice al finalizar la actualizacion. #
######################################################################
EOF
#
fi
sudo chmod +x /opt/extra-*
cd /
#
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-fdmr)"
@ -24,9 +67,8 @@ while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FDMR-Monitor OA4DOA" --menu "Nota Importante: antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo todas las configuraciones, al finalizar la actualizacion el servicio se reinniciara automaticamente.
" 17 50 4 \
1 " Update FreeDMR " \
2 " Update FDMR-Monitor OA4DOA " \
3 " Update FDMR-Monitor CS8ABG " \
4 " Menu Principal " 3>&1 1>&2 2>&3)
2 " Update FDMR-Monitor " \
3 " Menu Principal " 3>&1 1>&2 2>&3)
exitstatus=$?
#on recupere ce choix
#exitstatus=$?
@ -42,8 +84,6 @@ menu-up-fdm ;;
2)
menu-up-fdmon ;;
3)
menu-up-fdmon2 ;;
4)
break;
esac
done
@ -128,41 +168,6 @@ done
exit 0
EOF
sudo cat > /bin/menu-up-fdmon2 <<- "EOF"
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
whiptail --title "sudo su" --msgbox "requiere ser usuario root , escriba (sudo su) antes de entrar a menu / requires root user, type (sudo su) before entering menu" 0 50
exit 0
fi
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC / update FDMR-Monitor CS8ABG" --menu "Nota Importante: antes de iniciar la actualizacion, el proceso de actualizacion borrara por completo todas las configuraciones, al finalizar la actualizacion el servicio se reinniciara automaticamente.
" 17 50 4 \
1 " shell extra " \
2 " Iniciar Actualizacion FDMR-Monitor CS8ABG " \
3 " Menu Principal " 3>&1 1>&2 2>&3)
exitstatus=$?
#on recupere ce choix
#exitstatus=$?
if [ $exitstatus = 0 ]; then
echo "Your chosen option:" $choix
else
echo "You chose cancel."; break;
fi
# case : action en fonction du choix
case $choix in
1)
sudo nano /opt/extra-3.sh && chmod +x /opt/extra* ;;
2)
sh /opt/monitor-update2.sh ;;
3)
break;
esac
done
exit 0
EOF
######################################### FreeDMR Update ###############################################################
sudo cat > /opt/conf.txt <<- "EOFA1"
@ -806,7 +811,7 @@ systemctl start proxy.service
systemctl start http.server-fdmr.service
EOFB1
######################################### FDMR-Monitor2 Update ###############################################################
sudo cat > /opt/monitor2-update.sh <<- "EOFB2"
sudo cat > /opt/monitor-update.sh <<- "EOFB2"
cd /
if [ -d "/opt/FDMR-Monitor2" ]
then
@ -904,10 +909,6 @@ WantedBy=multi-user.target
EOF
systemctl daemon-reload
sh /opt/extra-3.sh
systemctl start fdmr_mon2.service
systemctl start proxy.service
systemctl start http.server-fdmr2.service
EOFB2
######################################################################################################################
# Cronedit

Loading…
Cancel
Save

Powered by TurnKey Linux.