Files
Virtnet.bond/gitapply.sh

20 lines
735 B
Bash
Executable File

#!/bin/bash
echo "Virtnet.bond Paymenter Load Balancer Git Repository Update and Apply"
echo "https://gitea.virtnet.bond/Joseph.Rawlings/Virtnet.bond/"
echo "------------------------------------------------------------------------"
sleep_time=$((RANDOM % 5 + 1))
cd /var/www/paymenter
echo "Sleeping for $sleep_time seconds..."
sleep "$sleep_time"
if ! git pull; then
echo "Git pull failed. Restarting script..."
exec "$0" "$@"
fi
php artisan view:clear
php artisan cache:clear
systemctl restart php8.3-fpm
echo "\n\n"
echo "------------------------------------------------------------------------"
echo "Paymenter has been updated successfully."
echo "------------------------------------------------------------------------"