Unterstütze uns! Spende jetzt!

Änderungen

Wechseln zu: Navigation, Suche

Tools/Wordpress-Plugin-Status

2.610 Bytes hinzugefügt, 12:58, 11. Jan. 2015
Die Seite wurde neu angelegt: „ <big>'''Dieses Skript dient zum "Ausspähen" der installierten Wordpress- und Plugin-Versionen alles Blogs des LVBB.'''</big> <div id="Vorlage_Lizenz_WTFPL"…“

<big>'''Dieses Skript dient zum "Ausspähen" der installierten Wordpress- und Plugin-Versionen alles Blogs des LVBB.'''</big>


<div id="Vorlage_Lizenz_WTFPL" style="clear:both; margin:0.5em auto; padding:0.5em; background-color:white; border:3px solid #FF8800; padding-left:2em; padding-right:2em;">
{|style="background-color:transparent;width:100%; text-align: center;"
|
[[Datei:WTFPL_logo.svg|link=http://www.wtfpl.net/|120px]]
|
Diese Datei wird unter der [http://www.wtfpl.net/ Do What the Fuck You Want to Public License"] zur Verfügung gestellt.

<pre>
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
</pre>
|}
</div>


<pre>
#!/bin/bash
#
# alle Wordpress- und Plugin-Versionen aus /var/www auslesen
#

set -e

IFS_BAK="$IFS";
IFS=$'\n';

ABSENDER="Der nette Admin <root by piratenbrandenburg.de>"
SENDTO="root-admins by piratenbrandenburg.de"

DATUM=$(date +%Y%m%d)

SUBJECT='wordpress status'

# tmp directory is fixed, tmp-file is determined randomly.
wp_tmpfile="$(mktemp -q /tmp/wp.XXXXXXXXXXXXXXXXXXXXXXXX)" || exit 1

echo -e "Beginn Check Wordpress- und Plugin-Versionen\n" > "$wp_tmpfile"

for page in $(find /var/www -type d -name 'wp-content') ; do

echo -e "\n### $page ###########\n" >> "$wp_tmpfile"

if [ -d "$page" ]; then

cd "$page"

if [ -f ../wp-includes/version.php ]; then

grep '^$wp_version' ../wp-includes/version.php >> "$wp_tmpfile"
echo "" >> "$wp_tmpfile"

fi

fi

plugindir="$page/plugins"

if [ -d "$plugindir" ]; then

phpfiles=$(find "$plugindir" -name '*.php')

for plugin in $phpfiles ; do

if pname=$(grep 'Plugin Name:' "$plugin") ; then

echo "$pname" >> "$wp_tmpfile"
grep -E '^\s*.?\s*Version:' "$plugin" >> "$wp_tmpfile"

fi

done

fi

done

echo -e "\n\nEnde Check Wordpress- und Plugin-Versionen" >> "$wp_tmpfile"

IFS="$IFS_BAK"

if [ -f "$wp_tmpfile" ]; then
mail -a "From: $ABSENDER" -s "[$(hostname)] $SUBJECT $DATUM" "$SENDTO" < "$wp_tmpfile"
rm -f "$wp_tmpfile" > /dev/null 2>&1
fi

exit 0

# eof
</pre>

<!-- Kategorien -->
[[Kategorie:Tools|Wordpress]]
9.127
Bearbeitungen

Navigationsmenü