1
0
Fork 0
paraderos_led/GenPoster/install-service.sh

29 lines
729 B
Bash
Executable File

#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Este script requiere permisos de root."
exit
fi
# set pwd to current directory
cd "$(dirname "$0")"
#limpia el contenido del directorio de trabajo
rm -rf /srv/parada*
mkdir /srv/parada_led
cp -rf *.py assets scripts /srv/parada_led
#Crea el servicio
cp -rf parada_led.service /etc/systemd/system/parada_led.service
# Recarga e inicia automaticamente al prender.
systemctl daemon-reload
systemctl unmask parada_led.service
systemctl enable parada_led.service
# Mensajes de salida
echo "Debe reiniciar la Raspberry para que el servicio pueda iniciarse"
echo "Luego para actualizar, solo debe modificar el el archivo '/srv/ledram/current.png' para actualizar la pantalla"