Obviamente este script no es gran cosa pero puede servir para las personas que están empezando a programar.
Esté script lo funciona con curl y es una hermosa herramienta en caso de encontrar lo que buscamos.
CODE
nano creadpag.sh
apt-get install jq
#!/bin/bash echo -e " ██████╗██████╗ ███████╗ █████╗ ██████╗ ██████╗ █████╗ ██████╗ ██╔════╝██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝ ██║ ██████╔╝█████╗ ███████║██║ ██║██████╔╝███████║██║ ███╗ ██║ ██╔══██╗██╔══╝ ██╔══██║██║ ██║██╔═══╝ ██╔══██║██║ ██║ ╚██████╗██║ ██║███████╗██║ ██║██████╔╝██║ ██║ ██║╚██████╔╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ " echo -e " \033[31m#######################################################\033[m example: bash creadpag.sh https://creadpag.com \033[31m#######################################################\033[m" url="$1" newestwp=$(curl -sSL http://api.wordpress.org/core/version-check/1.7 | jq -r .offers[0].current) runningwp=$(curl -s -N $url | grep 'wp-embed.min.js?ver=' | sed 's:.*=::' | cut -c1-5) if [ "$newestwp" == "$runningwp" ] ; then printf "%s is running Wordpress %s. Which is the newst version.\n" "$url" "$newestwp" else printf "%s is out of date. You are running %s and %s is the latest version.\n" "$url" "$runningwp" "$newestwp" fi exit 1 ;;
curl -sSL http://api.wordpress.org/core/version-check/1.7 | jq -r .offers[0].current
Demostración
bash creadpag.sh https://creadpag.com
0 Comentarios