Update install.sh
This commit is contained in:
parent
1e90ae5252
commit
9eea1b7695
139
install.sh
139
install.sh
|
|
@ -36,18 +36,18 @@ from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
callsign = "HP3ICC-99" # Callsign
|
callsign = "HP0XXX-13" # Callsign (HP0XXX-13)
|
||||||
password = "12345" # aprspasscode
|
password = "12345" # aprspasscode (12345)
|
||||||
latitude = "0830.60N" # DDMM.mmN (0831.27N)
|
latitude = "0823.48N" # DDMM.mmN (0831.27N)
|
||||||
longitude = "08021.57W" # DDDMM.mmW (08021.59W)
|
longitude = "08225.91W" # DDDMM.mmW (08021.59W)
|
||||||
comment = "Python APRS WX1" # WX comment
|
comment = "Python APRS WX1" # Beacon comment
|
||||||
simbol_primary = "/" # Primary symbol id
|
simbol_primary = "/" # Primary symbol id (/)
|
||||||
simbol_secundary = "_" # Secondary symbol code
|
simbol_secundary = "_" # Secondary symbol code (_)
|
||||||
serverHost = "rotate.aprs2.net" # aprs server url cwop.aprs.net / noam.aprs2.net
|
serverHost = "rotate.aprs2.net" # aprs server url cwop.aprs.net / noam.aprs2.net
|
||||||
serverPort = 14580 # aprs server port
|
serverPort = 14580 # aprs server port
|
||||||
every = 10 # Time in minutes to send WX
|
every = 10 # Time in minutes to send beacon
|
||||||
api_key = "YOU-APIKEY" # Your OpenWeatherMap API key
|
api_key = "APIKEY" # Your OpenWeatherMap API key (abcd12345567890)
|
||||||
map_id = "YOU-ID-MAP" # your OpenWeatherMap mapid
|
map_id = "MAP-ID" # Your OpenWeatherMap Map ID (123456)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -84,7 +84,7 @@ while True:
|
||||||
rain = str(rain).zfill(3)
|
rain = str(rain).zfill(3)
|
||||||
humidity = data["main"]["humidity"]
|
humidity = data["main"]["humidity"]
|
||||||
weather_description = data["weather"][0]["description"]
|
weather_description = data["weather"][0]["description"]
|
||||||
weather_data = f"{deg}/{wind}g{gust}t{temperature}r{rain}p000h{humidity}b{presure}0"
|
weather_data = f"{deg}/{wind}g{gust}{temperature}r{rain}p000h{humidity}b{presure}0"
|
||||||
else:
|
else:
|
||||||
weather_data = "Weather data not available"
|
weather_data = "Weather data not available"
|
||||||
current_time_utc = datetime.utcnow().strftime("%d%H%M")
|
current_time_utc = datetime.utcnow().strftime("%d%H%M")
|
||||||
|
|
@ -101,98 +101,6 @@ while True:
|
||||||
|
|
||||||
time.sleep(every * 60)
|
time.sleep(every * 60)
|
||||||
|
|
||||||
EOF
|
|
||||||
###########################
|
|
||||||
sudo cat > /bin/menu-py-wx <<- "EOF"
|
|
||||||
#!/bin/bash
|
|
||||||
while : ; do
|
|
||||||
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu Python-WX" --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion:" 23 56 13 \
|
|
||||||
1 " Editar WX-1 " \
|
|
||||||
2 " Editar WX-2 " \
|
|
||||||
3 " Editar WX-3 " \
|
|
||||||
4 " Editar WX-4 " \
|
|
||||||
5 " Editar WX-5 " \
|
|
||||||
6 " Editar WX-6 " \
|
|
||||||
7 " Editar WX-7 " \
|
|
||||||
8 " Editar WX-8 " \
|
|
||||||
9 " Start & Restart WX " \
|
|
||||||
10 " Stop WX " \
|
|
||||||
11 " 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/python-wx/wx1.py ;;
|
|
||||||
2)
|
|
||||||
sudo nano /opt/python-wx/wx2.py ;;
|
|
||||||
3)
|
|
||||||
sudo nano /opt/python-wx/wx3.py ;;
|
|
||||||
4)
|
|
||||||
sudo nano /opt/python-wx/wx4.py ;;
|
|
||||||
5)
|
|
||||||
sudo nano /opt/python-wx/wx5.py ;;
|
|
||||||
6)
|
|
||||||
sudo nano /opt/python-wx/wx6.py ;;
|
|
||||||
7)
|
|
||||||
sudo nano /opt/python-wx/wx7.py ;;
|
|
||||||
8)
|
|
||||||
sudo nano /opt/python-wx/wx8.py ;;
|
|
||||||
9)
|
|
||||||
choix_servicio=$(whiptail --title "Iniciar WX" --menu "Seleccione el WX a iniciar:" 15 40 8 \
|
|
||||||
1 "WX-1" \
|
|
||||||
2 "WX-2" \
|
|
||||||
3 "WX-3" \
|
|
||||||
4 "WX-4" \
|
|
||||||
5 "WX-5" \
|
|
||||||
6 "WX-6" \
|
|
||||||
7 "WX-7" \
|
|
||||||
8 "WX-8" \
|
|
||||||
3>&1 1>&2 2>&3)
|
|
||||||
exitstatus_servicio=$?
|
|
||||||
|
|
||||||
if [ $exitstatus_servicio = 0 ]; then
|
|
||||||
echo "Iniciar servicio: $choix_servicio"
|
|
||||||
# Agrega aqui la logica para iniciar el servicio correspondiente (usando el valor de $choix_servicio)
|
|
||||||
sudo systemctl stop py-wx$choix_servicio.service && sudo systemctl start py-wx$choix_servicio.service && sudo systemctl enable py-wx$choix_servicio.service
|
|
||||||
else
|
|
||||||
echo "Volver al menu principal."
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
10)
|
|
||||||
choix_servicio=$(whiptail --title "Detener WX" --menu "Seleccione el WX a detener:" 15 40 8 \
|
|
||||||
1 "WX-1" \
|
|
||||||
2 "WX-2" \
|
|
||||||
3 "WX-3" \
|
|
||||||
4 "WX-4" \
|
|
||||||
5 "WX-5" \
|
|
||||||
6 "WX-6" \
|
|
||||||
7 "WX-7" \
|
|
||||||
8 "WX-8" \
|
|
||||||
3>&1 1>&2 2>&3)
|
|
||||||
exitstatus_servicio=$?
|
|
||||||
|
|
||||||
if [ $exitstatus_servicio = 0 ]; then
|
|
||||||
echo "Detener servicio: $choix_servicio"
|
|
||||||
# Agrega aqui la logica para iniciar el servicio correspondiente (usando el valor de $choix_servicio)
|
|
||||||
sudo systemctl stop py-wx$choix_servicio.service && sudo systemctl disable py-wx$choix_servicio.service
|
|
||||||
else
|
|
||||||
echo "Volver al menu principal."
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
11)
|
|
||||||
break;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
######
|
######
|
||||||
chmod +x /bin/menu*
|
chmod +x /bin/menu*
|
||||||
|
|
@ -204,6 +112,10 @@ cp /opt/python-wx/wx1.py /opt/python-wx/wx5.py
|
||||||
cp /opt/python-wx/wx1.py /opt/python-wx/wx6.py
|
cp /opt/python-wx/wx1.py /opt/python-wx/wx6.py
|
||||||
cp /opt/python-wx/wx1.py /opt/python-wx/wx7.py
|
cp /opt/python-wx/wx1.py /opt/python-wx/wx7.py
|
||||||
cp /opt/python-wx/wx1.py /opt/python-wx/wx8.py
|
cp /opt/python-wx/wx1.py /opt/python-wx/wx8.py
|
||||||
|
cp /opt/python-wx/wx1.py /opt/python-wx/wx9.py
|
||||||
|
cp /opt/python-wx/wx1.py /opt/python-wx/wx10.py
|
||||||
|
cp /opt/python-wx/wx1.py /opt/python-wx/wx11.py
|
||||||
|
cp /opt/python-wx/wx1.py /opt/python-wx/wx12.py
|
||||||
|
|
||||||
sudo sed -i "s/Python APRS WX1/Python APRS WX1/g" /opt/python-wx/wx1.py
|
sudo sed -i "s/Python APRS WX1/Python APRS WX1/g" /opt/python-wx/wx1.py
|
||||||
sudo sed -i "s/Python APRS WX1/Python APRS WX2/g" /opt/python-wx/wx2.py
|
sudo sed -i "s/Python APRS WX1/Python APRS WX2/g" /opt/python-wx/wx2.py
|
||||||
|
|
@ -213,6 +125,10 @@ sudo sed -i "s/Python APRS WX1/Python APRS WX5/g" /opt/python-wx/wx5.py
|
||||||
sudo sed -i "s/Python APRS WX1/Python APRS WX6/g" /opt/python-wx/wx6.py
|
sudo sed -i "s/Python APRS WX1/Python APRS WX6/g" /opt/python-wx/wx6.py
|
||||||
sudo sed -i "s/Python APRS WX1/Python APRS WX7/g" /opt/python-wx/wx7.py
|
sudo sed -i "s/Python APRS WX1/Python APRS WX7/g" /opt/python-wx/wx7.py
|
||||||
sudo sed -i "s/Python APRS WX1/Python APRS WX8/g" /opt/python-wx/wx8.py
|
sudo sed -i "s/Python APRS WX1/Python APRS WX8/g" /opt/python-wx/wx8.py
|
||||||
|
sudo sed -i "s/Python APRS WX1/Python APRS WX9/g" /opt/python-wx/wx9.py
|
||||||
|
sudo sed -i "s/Python APRS WX1/Python APRS WX10/g" /opt/python-wx/wx10.py
|
||||||
|
sudo sed -i "s/Python APRS WX1/Python APRS WX11/g" /opt/python-wx/wx11.py
|
||||||
|
sudo sed -i "s/Python APRS WX1/Python APRS WX12/g" /opt/python-wx/wx12.py
|
||||||
|
|
||||||
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx2.service
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx2.service
|
||||||
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx3.service
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx3.service
|
||||||
|
|
@ -221,6 +137,10 @@ cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx5.service
|
||||||
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx6.service
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx6.service
|
||||||
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx7.service
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx7.service
|
||||||
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx8.service
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx8.service
|
||||||
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx9.service
|
||||||
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx10.service
|
||||||
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx11.service
|
||||||
|
cp /lib/systemd/system/py-wx1.service /lib/systemd/system/py-wx12.service
|
||||||
|
|
||||||
sudo sed -i "s/WX1/WX2/g" /lib/systemd/system/py-wx2.service
|
sudo sed -i "s/WX1/WX2/g" /lib/systemd/system/py-wx2.service
|
||||||
sudo sed -i "s/WX1/WX3/g" /lib/systemd/system/py-wx3.service
|
sudo sed -i "s/WX1/WX3/g" /lib/systemd/system/py-wx3.service
|
||||||
|
|
@ -229,6 +149,10 @@ sudo sed -i "s/WX1/WX5/g" /lib/systemd/system/py-wx5.service
|
||||||
sudo sed -i "s/WX1/WX6/g" /lib/systemd/system/py-wx6.service
|
sudo sed -i "s/WX1/WX6/g" /lib/systemd/system/py-wx6.service
|
||||||
sudo sed -i "s/WX1/WX7/g" /lib/systemd/system/py-wx7.service
|
sudo sed -i "s/WX1/WX7/g" /lib/systemd/system/py-wx7.service
|
||||||
sudo sed -i "s/WX1/WX8/g" /lib/systemd/system/py-wx8.service
|
sudo sed -i "s/WX1/WX8/g" /lib/systemd/system/py-wx8.service
|
||||||
|
sudo sed -i "s/WX1/WX9/g" /lib/systemd/system/py-wx9.service
|
||||||
|
sudo sed -i "s/WX1/WX10/g" /lib/systemd/system/py-wx10.service
|
||||||
|
sudo sed -i "s/WX1/WX11/g" /lib/systemd/system/py-wx11.service
|
||||||
|
sudo sed -i "s/WX1/WX12/g" /lib/systemd/system/py-wx12.service
|
||||||
|
|
||||||
sudo sed -i "s/wx1/wx2/g" /lib/systemd/system/py-wx2.service
|
sudo sed -i "s/wx1/wx2/g" /lib/systemd/system/py-wx2.service
|
||||||
sudo sed -i "s/wx1/wx3/g" /lib/systemd/system/py-wx3.service
|
sudo sed -i "s/wx1/wx3/g" /lib/systemd/system/py-wx3.service
|
||||||
|
|
@ -237,6 +161,10 @@ sudo sed -i "s/wx1/wx5/g" /lib/systemd/system/py-wx5.service
|
||||||
sudo sed -i "s/wx1/wx6/g" /lib/systemd/system/py-wx6.service
|
sudo sed -i "s/wx1/wx6/g" /lib/systemd/system/py-wx6.service
|
||||||
sudo sed -i "s/wx1/wx7/g" /lib/systemd/system/py-wx7.service
|
sudo sed -i "s/wx1/wx7/g" /lib/systemd/system/py-wx7.service
|
||||||
sudo sed -i "s/wx1/wx8/g" /lib/systemd/system/py-wx8.service
|
sudo sed -i "s/wx1/wx8/g" /lib/systemd/system/py-wx8.service
|
||||||
|
sudo sed -i "s/wx1/wx9/g" /lib/systemd/system/py-wx9.service
|
||||||
|
sudo sed -i "s/wx1/wx10/g" /lib/systemd/system/py-wx10.service
|
||||||
|
sudo sed -i "s/wx1/wx11/g" /lib/systemd/system/py-wx11.service
|
||||||
|
sudo sed -i "s/wx1/wx12/g" /lib/systemd/system/py-wx12.service
|
||||||
|
|
||||||
sudo chmod 644 /lib/systemd/system/py-wx1.service
|
sudo chmod 644 /lib/systemd/system/py-wx1.service
|
||||||
sudo chmod 644 /lib/systemd/system/py-wx2.service
|
sudo chmod 644 /lib/systemd/system/py-wx2.service
|
||||||
|
|
@ -246,6 +174,11 @@ sudo chmod 644 /lib/systemd/system/py-wx5.service
|
||||||
sudo chmod 644 /lib/systemd/system/py-wx6.service
|
sudo chmod 644 /lib/systemd/system/py-wx6.service
|
||||||
sudo chmod 644 /lib/systemd/system/py-wx7.service
|
sudo chmod 644 /lib/systemd/system/py-wx7.service
|
||||||
sudo chmod 644 /lib/systemd/system/py-wx8.service
|
sudo chmod 644 /lib/systemd/system/py-wx8.service
|
||||||
|
sudo chmod 644 /lib/systemd/system/py-wx9.service
|
||||||
|
sudo chmod 644 /lib/systemd/system/py-wx10.service
|
||||||
|
sudo chmod 644 /lib/systemd/system/py-wx11.service
|
||||||
|
sudo chmod 644 /lib/systemd/system/py-wx12.service
|
||||||
|
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
chmod +x /opt/python-wx/*
|
chmod +x /opt/python-wx/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue