Fix update script

This commit is contained in:
0d0acre 2024-09-21 01:52:46 +02:00
parent 6840e2a877
commit 6df37908d6

View file

@ -2,20 +2,23 @@
# Script per aggiornare ruscomap
# nano /var/www/html/leaflet/ruscomap/AggiornaRuscoMap.sh
ruscomap_dir="/var/www/html/leaflet/ruscomap"
ruscomap_public="/var/www/html/leaflet/ruscomap/public"
echo -e "\nStoppo ruscomap..."
systemctl stop ruscomap.service || echo -e "\nErrore nell'arrestare ruscomap!\n"
cd /var/www/html/leaflet/ruscomap
cd "${ruscomap_dir}" || exit 1
echo -e "\nEseguo git pull..."
git pull || echo -e "\nErrore git!\n" && systemctl start ruscomap.service
git pull || echo -e "\nErrore git!\n"
cd "server" || exit 1
npm ci
systemctl start ruscomap.service
echo -e "\nDo permessi www-data..."
chown -R www-data:www-data /var/www/html/leaflet/ruscomap/public || echo -e "\nErrore nel dare i permessi a /var/www/html/leaflet/ruscomap/public\n"
chown -R www-data:www-data "$ruscomap_public" || echo -e "\nErrore nel dare i permessi a $ruscomap_public \n"
echo -e "\nrestarto apache e ruscmap"...
echo -e "\nrestarto apache e ruscomap"...
systemctl restart apache2.service && echo "apache restart"
systemctl start ruscomap.service && echo "rusco restart"