Advertisement

header ads

CREAR TU PROPIO SCRIPT PARA COMPROBAR LA VERSION DE WORDPRESS DE UN SITIO WEB

El otro día me puse hacer mucha copia de seguridad en mi encontré muchos script armados y se me ocurrió compartir algunos para ustedes.

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
;;
Con el siguiente comando podrás ver la versión actual de wordpress
curl -sSL http://api.wordpress.org/core/version-check/1.7 | jq -r .offers[0].current

Demostración

bash creadpag.sh https://creadpag.com
Y el siguiente comando es para ordenar que busque la versión del host y en caso de no ser wordpress te da un aviso. Curl es una linda herramienta como wget que puede extraer cosas algunos datos si te gusto este script no te olvides en compartirlo, para publicar otro script para obtener más info.

Publicar un comentario

0 Comentarios