1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 08:12:48 +01:00
imapsync/memo
Nick Bebout 3f8607bd96 1.366
2011-03-12 02:45:02 +00:00

111 lines
2.6 KiB
Bash

#!/bin/sh
# $Id: memo,v 1.23 2010/10/24 23:49:28 gilles Exp gilles $
software_version() {
VERSION=`cat VERSION`
}
statistics_lfo() {
#grep prj/imapsync/VERSION /usr/local/apache/logs/access_log | sort -n | cut -d ' ' -f 1,12,13|uniq -c | sort -n # list ip
cat <<EOFF
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|sort -n|cut -d ' ' -f 1,12,13|uniq -c|sort -n # list ip
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|grep MSWin32|cut -d ' ' -f 1,12,13|sort -n|uniq -c| sort -n # Win32
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|grep -v MSWin32|cut -d ' ' -f 1,12,13|sort -n|uniq -c| sort -n # No Win32
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 13|sort -n|uniq -c| sort -n # OS usage
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 12|sort -n|uniq -c| sort -n # imapsync release
tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency'
EOFF
}
niouzes_compil() {
DIR_SAVE=`pwd`
cd /home/gilles/public_html/www.linux-france.org/html/
m4 niouzes.m4 > niouzes.xml
python ./niouzes/getmynews.py --neuf niouzes.xml > niouzes-neuf.html
python ./niouzes/getmynews.py --html niouzes.xml > niouzes-html.html
cd $DIR_SAVE
}
lfo_announce() {
software_version
NEWS_FILE="/home/gilles/public_html/www.linux-france.org/html/niouzes/niouzes_imapsync.xml"
if ! newer VERSION $NEWS_FILE; then
echo "$VERSION already announced"
else
cat > $NEWS_FILE << EOF
<news date="`date '+%Y%m%d'`">
`LANG=fr_FR date '+%A %d %B %Y'` : Synchronisez ou migrez vos boites
aux lettres avec économie et l'outil <A
HREF="prj/imapsync/">imapsync $VERSION</A> (Gilles LAMIRAL)
</news>
EOF
fi
niouzes_compil
}
#' nedit sucks with syntax color
fm_init() {
software_version
NEWS_FILE_FM="./freshmeat_submition"
NEWS_FILE_FM_INP=${NEWS_FILE_FM}.inp
NEWS_FILE_FM_OUT=${NEWS_FILE_FM}.json
}
fm_read_param() {
# read definitions
. $NEWS_FILE_FM_INP
}
fm_read_announce() {
fm_init
fm_read_param
cat << EOF
{
"release": {
"tag_list": "stable, $RELEASE_FOCUS",
"version": "$VERSION",
"hidden_from_frontpage": false,
"changelog": "$TEXT_BODY"
}
}
EOF
}
fm_announce() {
fm_init
if ! newer VERSION $NEWS_FILE_FM_OUT; then
echo "$VERSION already submitted on freshmeat"
else
if newer VERSION $NEWS_FILE_FM_INP; then
echo "Update $NEWS_FILE_FM_INP please"
return 1
fi
fm_read_announce > $NEWS_FILE_FM_OUT
curl -X PUT -d @../../var/pass/secret.freshmeat -d @$NEWS_FILE_FM_OUT \
-H "Content-Type: application/json" \
http://freshmeat.net/projects/imapsync.json
fi
}