Skip to content

Instantly share code, notes, and snippets.

@nbyouri
Last active August 29, 2015 14:25
Show Gist options
  • Save nbyouri/adc402a824ea292e459b to your computer and use it in GitHub Desktop.
Save nbyouri/adc402a824ea292e459b to your computer and use it in GitHub Desktop.
xfce_panel-plugins_version-check
#!/bin/ksh
# TODO: Adapt to apps, xfce, art, thunar-plugins
xfce_site="http://archive.xfce.org/src/panel-plugins/"
set -A plugins "xfce4-battery-plugin xfce4-calculator-plugin xfce4-cddrive-plugin
xfce4-cellmodem-plugin xfce4-clipman-plugin xfce4-cpufreq-plugin
xfce4-cpugraph-plugin xfce4-datetime-plugin xfce4-dict-plugin
xfce4-diskperf-plugin xfce4-embed-plugin xfce4-equake-plugin
xfce4-eyes-plugin xfce4-fsguard-plugin xfce4-generic-slider
xfce4-genmon-plugin xfce4-gvfs-mount xfce4-hardware-monitor-plugin
xfce4-i8k-plugin xfce4-iicapn-plugin xfce4-indicator-plugin
xfce4-kbdleds-plugin xfce4-linelight-plugin xfce4-lua-graph-plugin
xfce4-mailwatch-plugin xfce4-megahertz-plugin xfce4-modemlights-plugin
xfce4-mount-plugin xfce4-mpc-plugin xfce4-netload-plugin xfce4-notes-plugin
xfce4-places-plugin xfce4-playercontrol-plugin xfce4-pulseaudio-plugin
xfce4-quicklauncher-plugin xfce4-radio-plugin xfce4-rss-plugin
xfce4-sample-plugin xfce4-screenshooter-plugin xfce4-sensors-plugin
xfce4-smartbookmark-plugin xfce4-smartpm-plugin xfce4-stopwatch-plugin
xfce4-systemload-plugin xfce4-taskbar-plugin xfce4-teatime-plugin
xfce4-time-out-plugin xfce4-timer-plugin xfce4-trigger-launcher
xfce4-verve-plugin xfce4-wavelan-plugin xfce4-weather-plugin
xfce4-websearch-plugin xfce4-whiskermenu-plugin xfce4-wmdock-plugin
xfce4-xfapplet-plugin xfce4-xkb-plugin xfce4-xmms-plugin"
get_pkgsrc_version() {
pkg_url="http://pkgsrc.se/search.php?so=$1"
pkgse_version=`curl -s -L $pkg_url|grep -o '<b>version .*</b>'|awk -F"<" '{sub(/<b>version\ /, "");print $1}'`
if [ -z $pkgse_version ]; then
echo "/"
else
echo $pkgse_version
fi
}
get_last_version() {
for plugin in ${plugins[@]}; do
html=`curl -s -L $xfce_site$plugin|fgrep "folder"|tail -1`
folder=`echo $html | awk -F"\"" '{print "/"$4}'`
if [ `echo $html | sed '/^$/d' |wc -l` -gt 0 ]; then
html=`curl -s -L $xfce_site$plugin$folder | fgrep "archive"|tail -1`
archive=`echo $html | awk -F"\"" '{print $4}'`
latest_version=`echo $archive | awk -F"-" '{sub(/\.tar\..*/, ""); print $NF}'`
if [ `echo $html | sed '/^$/d' | wc -l` -gt 0 ]; then
printf "$plugin\t:\t$latest_version\t:\t"
get_pkgsrc_version $plugin
fi
fi
done
}
get_last_version;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment