4
Luego de contar con acceso remoto es necesario crear un script de arranque para el
inicio del programa SUPERACCESS, siguiendo los siguientes pasos.
1
Debemos abrir un terminal y ejecutar los siguientes comandos.
sudo nano /etc/init.d/globalConfig
De esta forma tendremos un editor de texto donde debemos guardar las siguientes
instrucciones
www.superaccess.co
#!/bin/bash
case "$1" in
start)
cd /home/pi/Desktop/Raspberry/
while read -r line;
do
if [ "$line" == "MOL" ]; then
cd MolineteRaspberryPI/
echo "Inicio Molinete"
sudo java -jar MolineteRaspberryPI.jar
exit 1
elif [ "$line" == "TAL" ]; then
cd TalanqueraRaspberryPI/
echo "Iniciando Talanquera"
sudo java -jar TalanqueraRaspberryPI.jar
exit 2
elif [ "$line" == "VIP" ]; then
cd PedestalRaspberryPI/
echo "Iniciando Pedestal"
sudo java -jar PedestalRaspberryPI.jar
exit 3
elif [ "$line" == "MAG" ]; then
cd MagneticaRaspberryPI/
echo "Iniciando Puerta Magneticas-Discapacitados"
sudo java -jar MagneticaRaspberryPI.jar
exit 4
else
echo "Opcion No Valida"
fi
done < Config.txt
;;
stop)
cd /home/pi/Desktop/Raspberry/
while read -r line;
do
if [ "$line" == "MOL" ]; then
pid=`ps aux | grep MolineteRaspberryPI.jar | awk '{print $2}'`
kill -9 $pid
elif [ "$line" == "TAL" ]; then
pid=`ps aux | grep TalanqueraRaspberryPI.jar | awk '{print $2}'`
kill -9 $pid
elif [ "$line" == "VIP" ]; then
pid=`ps aux | grep PedestalRaspberryPI.jar | awk '{print $2}'`
kill -9 $pid
elif [ "$line" == "MAG" ]; then
pid=`ps aux | grep MagneticaRaspberryPI.jar | awk '{print $2}'`
kill -9 $pid
else
echo "Opcion No Valida"
fi
done < Config.txt
;;
*)
echo $"Uso del comando: se ejecuta con las siguientes dos opciones : {start|stop}"
exit 6
;;
esac
Manual
acceso multilectora k-1004
Configuración Global Superaccess
de
alistamiento
sistema
de
control
de
9