2011-03-12 03:43:54 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-01-22 17:52:28 +01:00
|
|
|
# $Id: memo,v 1.63 2015/12/18 20:53:37 gilles Exp gilles $
|
2013-07-06 00:26:28 +02:00
|
|
|
|
|
|
|
count_nice() {
|
|
|
|
|
|
|
|
#set -x
|
|
|
|
# count # prints 01 02 03 04 05 06 07 08 09 10
|
|
|
|
# count 2 # prints 2 3 4 5 6 7 8 9 10 11
|
|
|
|
# count 005 # prints 005 006 007 008 009 010 011 012 013 014
|
|
|
|
# count 5 23 # prints 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
|
|
|
# count 5 23 3 # prints 5 8 11 14 17 20 23
|
|
|
|
|
|
|
|
nb_from=${1:-"01"}
|
|
|
|
nb_from_ln=`expr length $nb_from`
|
|
|
|
|
|
|
|
nb_to=${2:-`expr $nb_from + 9`}
|
|
|
|
nb_incr=${3:-"1"}
|
|
|
|
nb_counter=$nb_from
|
|
|
|
while test $nb_counter -le $nb_to;do
|
|
|
|
nb_list="$nb_list $nb_counter"
|
|
|
|
nb_counter=`expr $nb_counter + $nb_incr`
|
|
|
|
nb_counter=`printf %0${nb_from_ln}d $nb_counter`
|
|
|
|
done
|
|
|
|
echo $nb_list
|
|
|
|
#set +x
|
|
|
|
}
|
|
|
|
|
2011-03-12 03:43:54 +01:00
|
|
|
|
|
|
|
software_version() {
|
|
|
|
|
|
|
|
VERSION=`cat VERSION`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
statistics_lfo_frequency() {
|
2011-03-12 03:45:02 +01:00
|
|
|
cat <<EOFF
|
2011-09-25 22:31:48 +02:00
|
|
|
tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency
|
2011-03-12 03:45:02 +01:00
|
|
|
EOFF
|
|
|
|
}
|
|
|
|
|
2012-04-17 00:26:18 +02:00
|
|
|
statistics_lfo_run() {
|
|
|
|
# 62.147.165.21 - - [31/Oct/2010:23:45:28 +0100] "GET /prj/imapsync/VERSION HTTP/1.0" 200 6 "-" "imapsync/1.368 (linux system, perl 5.8.8, Mail::IMAPClient 2.2.9 imapsync)"
|
|
|
|
#grep prj/imapsync/VERSION /usr/local/apache/logs/access_log | sort -n | cut -d ' ' -f 1,12,13|uniq -c | sort -n # list ip
|
|
|
|
|
|
|
|
echo lfo list ip
|
|
|
|
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip
|
|
|
|
echo lfo Win32
|
|
|
|
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32
|
|
|
|
echo lfo OS usage+basename
|
|
|
|
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename
|
|
|
|
echo lfo imapsync release
|
|
|
|
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release
|
|
|
|
echo -n "lfo count ip: "
|
|
|
|
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n|wc -l" # count ip
|
|
|
|
echo -n "lfo imapsync runs: "
|
|
|
|
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|wc -l" # imapsync runs
|
2012-04-17 00:31:15 +02:00
|
|
|
date
|
2012-04-17 00:26:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
statistics_ks_frequency() {
|
2011-07-11 23:24:12 +02:00
|
|
|
|
|
|
|
cat <<EOFF
|
2011-09-25 22:31:48 +02:00
|
|
|
tail -f /var/log/apache2/access.log |cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # ks frequency
|
2011-07-11 23:24:12 +02:00
|
|
|
EOFF
|
|
|
|
}
|
|
|
|
|
2012-04-17 00:26:18 +02:00
|
|
|
statistics_ks_run() {
|
|
|
|
|
|
|
|
echo ks list ip
|
|
|
|
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log_????????|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip
|
|
|
|
echo ks Win32
|
|
|
|
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log_????????|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32
|
|
|
|
echo OS usage+basename
|
|
|
|
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log_????????|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename
|
|
|
|
echo ks imapsync release
|
|
|
|
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log_????????|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release
|
|
|
|
echo -n "ks count ip: "
|
|
|
|
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log_????????|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n|wc -l" # count ip
|
|
|
|
echo -n "ks imapsync runs: "
|
|
|
|
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log_????????|wc -l" # imapsync runs
|
2012-04-17 00:31:15 +02:00
|
|
|
date
|
2012-04-17 00:26:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
statistics_VERSION_lfo() {
|
2011-03-12 03:45:02 +01:00
|
|
|
|
2011-06-14 12:59:46 +02:00
|
|
|
TMPDIR=.
|
|
|
|
export TMPDIR
|
|
|
|
|
|
|
|
echo statistics_VERSION_getstats
|
|
|
|
statistics_VERSION_getstats() {
|
2012-04-17 00:30:19 +02:00
|
|
|
for f in /home/lf/backuplog/linux-france.org.??-??-201[123456789].bz2; do
|
2011-06-14 12:59:46 +02:00
|
|
|
b=`basename "$f" .bz2`
|
2011-09-25 22:31:48 +02:00
|
|
|
#echo "$b"
|
2011-06-14 12:59:46 +02:00
|
|
|
test -f ${b}.imapsync_VERSION && continue
|
|
|
|
echo NOT DONE ${b}.imapsync_VERSION
|
|
|
|
bzip2 -dc "$f" | grep -h /prj/imapsync/VERSION > ${b}.imapsync_VERSION
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_monthly_ip 02 2012 # long"
|
2011-06-14 12:59:46 +02:00
|
|
|
statistics_VERSION_monthly_ip() {
|
2015-05-28 19:04:57 +02:00
|
|
|
statistics_VERSION_getstats
|
2011-09-25 22:31:48 +02:00
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
2015-05-28 19:04:57 +02:00
|
|
|
ls linux-france.org.??-${month}-${year}.imapsync_VERSION || return 1
|
2012-04-17 00:30:19 +02:00
|
|
|
cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-${month}-${year}.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}_${month}.ip
|
2011-06-14 12:59:46 +02:00
|
|
|
}
|
|
|
|
|
2015-05-28 19:04:57 +02:00
|
|
|
echo "verify_month_year 02 2015"
|
|
|
|
verify_month_year() {
|
|
|
|
month=${1:-`date '+%m'`}
|
|
|
|
year=${2:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
fmy="stats_imapsync_${year}_${month}.ip"
|
|
|
|
test -f "$fmy" || { echo "No $fmy" ; statistics_VERSION_monthly_ip ${month} ${year} ; }
|
|
|
|
test -f "$fmy" || { echo "No $fmy" ; return 1 ; }
|
|
|
|
fmy_YYYYmm=`date -r "$fmy" +%Y%m`
|
2015-12-03 18:16:32 +01:00
|
|
|
diff_month=`expr $fmy_YYYYmm - ${year}${month}` || :
|
2015-05-28 19:04:57 +02:00
|
|
|
echo -n $diff_month
|
|
|
|
test "$diff_month" -ge 1 && echo " is enough" && return 0
|
|
|
|
echo " is not enough"
|
|
|
|
statistics_VERSION_monthly_ip $month $year
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "verify_year 2015"
|
|
|
|
verify_year() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
now_yearmonth=`date '+%Y%m'`
|
|
|
|
for month in `count_nice 01 12`; do
|
|
|
|
test "$now_yearmonth" -ge "$year$month" && \
|
|
|
|
verify_month_year $month $year
|
|
|
|
done
|
|
|
|
statistics_VERSION_yearly_ip $year
|
2015-12-03 18:16:32 +01:00
|
|
|
statistics_VERSION_synthesis $year
|
2015-05-28 19:04:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_monthly_ip_wc 02 2012 # short"
|
2011-06-14 12:59:46 +02:00
|
|
|
statistics_VERSION_monthly_ip_wc() {
|
2011-09-25 22:31:48 +02:00
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
|
|
|
test -f stats_imapsync_${year}_${month}.ip || statistics_VERSION_monthly_ip $month ${year}
|
|
|
|
wc -l stats_imapsync_${year}_${month}.ip
|
2011-06-14 12:59:46 +02:00
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_monthly_runs 02 2012 # short"
|
2011-06-14 12:59:46 +02:00
|
|
|
statistics_VERSION_monthly_runs() {
|
2011-09-25 22:31:48 +02:00
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
|
|
|
test -f stats_imapsync_${year}_${month}.runs || wc -l linux-france.org.??-${month}-${year}.imapsync_VERSION > stats_imapsync_${year}_${month}.runs
|
|
|
|
cat stats_imapsync_${year}_${month}.runs
|
2011-06-14 12:59:46 +02:00
|
|
|
}
|
2011-09-25 22:31:48 +02:00
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_yearly_os 2012 # short"
|
|
|
|
statistics_VERSION_yearly_os() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd /home/lf/glamiral/imapsync_stats
|
|
|
|
Linux=`grep -i linux stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Win32=`grep -i MSWin32 stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Darwin=`grep -i darwin stats_imapsync_${year}.ip | wc -l`
|
|
|
|
FreeBSD=`grep -i freebsd stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Solaris=`grep -i solaris stats_imapsync_${year}.ip | wc -l`
|
|
|
|
OpenBSD=`grep -i openbsd stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Other=`egrep -i -v 'linux|MSWin32|darwin|freebsd|solaris|openbsd' stats_imapsync_${year}.ip |wc -l`
|
|
|
|
Nb_All=`cat stats_imapsync_${year}.ip | wc -l`
|
|
|
|
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD Other; do
|
|
|
|
#echo $OS `eval "echo \\$$OS"` / $Nb_All
|
|
|
|
Nb_OS=`eval "echo \\$$OS"`
|
|
|
|
PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l`
|
|
|
|
echo $OS $PerCent %
|
|
|
|
done
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "statistics_VERSION_monthly 02 2012 # long, good choice"
|
2011-09-25 22:31:48 +02:00
|
|
|
statistics_VERSION_monthly() {
|
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
2011-09-25 22:31:48 +02:00
|
|
|
(
|
|
|
|
statistics_VERSION_getstats
|
2012-04-17 00:30:19 +02:00
|
|
|
statistics_VERSION_monthly_ip $month $year
|
|
|
|
statistics_VERSION_monthly_runs $month $year
|
|
|
|
statistics_VERSION_monthly_ip_wc $month $year
|
2011-09-25 22:31:48 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2012-04-17 00:30:19 +02:00
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_yearly_ip 2012 # very long"
|
2012-04-17 00:26:18 +02:00
|
|
|
statistics_VERSION_yearly_ip() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
2012-12-29 01:43:39 +01:00
|
|
|
statistics_VERSION_getstats
|
2012-04-17 00:26:18 +02:00
|
|
|
cd /home/lf/glamiral/imapsync_stats
|
|
|
|
cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-??-${year}.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}.ip
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2013-07-06 00:26:28 +02:00
|
|
|
statistics_VERSION_yearly_runs() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd /home/lf/glamiral/imapsync_stats
|
|
|
|
test -f stats_imapsync_${year}.ip && cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_synthesis 2012 # short"
|
2011-09-25 22:31:48 +02:00
|
|
|
statistics_VERSION_synthesis() {
|
2012-04-17 00:26:18 +02:00
|
|
|
year=${1:-`date '+%Y'`}
|
2015-12-03 18:16:32 +01:00
|
|
|
year_now=`date '+%Y'`
|
2011-09-25 22:31:48 +02:00
|
|
|
(
|
|
|
|
cd /home/lf/glamiral/imapsync_stats
|
|
|
|
echo Nb users each month
|
2012-04-17 00:26:18 +02:00
|
|
|
wc -l stats_imapsync_${year}_??.ip
|
2011-09-25 22:31:48 +02:00
|
|
|
echo Nb runs each month
|
2012-04-17 00:26:18 +02:00
|
|
|
tail -n 1 stats_imapsync_${year}_??.runs
|
|
|
|
echo % Operating systems
|
|
|
|
statistics_VERSION_yearly_os $year
|
|
|
|
echo Biggest users
|
|
|
|
tail -n 5 stats_imapsync_${year}.ip
|
2013-07-06 00:26:28 +02:00
|
|
|
echo Nb users each year
|
|
|
|
wc -l stats_imapsync_????.ip
|
|
|
|
echo "Nb runs each year : "
|
2015-12-03 18:16:32 +01:00
|
|
|
for yyyy in `count_nice 2011 ${year_now}`; do
|
2013-07-06 00:26:28 +02:00
|
|
|
echo -n "$yyyy: "
|
|
|
|
statistics_VERSION_yearly_runs $yyyy
|
|
|
|
done
|
2015-12-03 18:16:32 +01:00
|
|
|
nb_runs_current_year=`statistics_VERSION_yearly_runs $year_now`
|
|
|
|
current_day_of_year=`date +%j`
|
|
|
|
echo; echo -n "$year_now~~"
|
|
|
|
echo "$nb_runs_current_year/$current_day_of_year*365" | bc
|
2011-09-25 22:31:48 +02:00
|
|
|
)
|
2015-08-04 03:44:40 +02:00
|
|
|
|
2011-09-25 22:31:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
}
|
2011-06-14 12:59:46 +02:00
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
statistics_VERSION_ks() {
|
2011-06-14 12:59:46 +02:00
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
TMPDIR=.
|
|
|
|
export TMPDIR
|
2011-06-14 12:59:46 +02:00
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
echo statistics_VERSION_getstats
|
|
|
|
statistics_VERSION_getstats() {
|
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2011-07-11 23:24:12 +02:00
|
|
|
for f in /var/log/apache2/access.log_????????.gz ; do
|
|
|
|
b=`basename "$f" .gz`
|
2011-09-25 22:31:48 +02:00
|
|
|
#echo "$b"
|
2011-07-11 23:24:12 +02:00
|
|
|
test -f ${b}.imapsync_VERSION && continue
|
|
|
|
echo NOT DONE ${b}.imapsync_VERSION
|
|
|
|
zgrep -h /prj/imapsync/VERSION "$f" > ${b}.imapsync_VERSION
|
|
|
|
done
|
|
|
|
)
|
2011-06-14 12:59:46 +02:00
|
|
|
}
|
2011-03-12 03:45:02 +01:00
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_monthly_ip 02 2012 # long"
|
2011-07-11 23:24:12 +02:00
|
|
|
statistics_VERSION_monthly_ip() {
|
2015-05-28 19:04:57 +02:00
|
|
|
statistics_VERSION_getstats
|
2011-09-25 22:31:48 +02:00
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
2011-07-11 23:24:12 +02:00
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2015-05-28 19:04:57 +02:00
|
|
|
ls access.log_${year}${month}??.imapsync_VERSION || return 1
|
2015-12-03 18:16:32 +01:00
|
|
|
cut -d ' ' -f 1,12,13,15,16,18,19 access.log_${year}${month}??.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}_${month}.ip
|
2011-07-11 23:24:12 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2015-05-28 19:04:57 +02:00
|
|
|
echo "verify_month_year 02 2015"
|
|
|
|
verify_month_year() {
|
|
|
|
month=${1:-`date '+%m'`}
|
|
|
|
year=${2:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
fmy="stats_imapsync_${year}_${month}.ip"
|
|
|
|
test -f "$fmy" || { echo "No $fmy" ; statistics_VERSION_monthly_ip ${month} ${year} ; }
|
|
|
|
test -f "$fmy" || { echo "No $fmy" ; return 1 ; }
|
|
|
|
fmy_YYYYmm=`date -r "$fmy" +%Y%m`
|
2015-12-03 18:16:32 +01:00
|
|
|
diff_month=`expr $fmy_YYYYmm - ${year}${month}` || :
|
2015-05-28 19:04:57 +02:00
|
|
|
echo -n $diff_month
|
|
|
|
test "$diff_month" -ge 1 && echo " is enough" && return 0
|
|
|
|
echo " is not enough"
|
|
|
|
statistics_VERSION_monthly $month $year
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "verify_year 2015"
|
|
|
|
verify_year() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
now_yearmonth=`date '+%Y%m'`
|
|
|
|
for month in `count_nice 01 12`; do
|
|
|
|
test "$now_yearmonth" -ge "$year$month" && \
|
|
|
|
verify_month_year $month $year
|
|
|
|
done
|
|
|
|
statistics_VERSION_yearly_ip $year
|
2015-12-03 18:16:32 +01:00
|
|
|
statistics_VERSION_synthesis $year
|
2015-05-28 19:04:57 +02:00
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_monthly_os 08 2012 # short"
|
2012-04-17 00:26:18 +02:00
|
|
|
statistics_VERSION_monthly_os() {
|
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
2012-04-17 00:26:18 +02:00
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2012-12-29 01:43:39 +01:00
|
|
|
Linux=`grep -i linux stats_imapsync_${year}_${month}.ip | wc -l`
|
|
|
|
Win32=`grep -i MSWin32 stats_imapsync_${year}_${month}.ip | wc -l`
|
|
|
|
Darwin=`grep -i darwin stats_imapsync_${year}_${month}.ip | wc -l`
|
|
|
|
FreeBSD=`grep -i freebsd stats_imapsync_${year}_${month}.ip | wc -l`
|
|
|
|
Solaris=`grep -i solaris stats_imapsync_${year}_${month}.ip | wc -l`
|
|
|
|
OpenBSD=`grep -i openbsd stats_imapsync_${year}_${month}.ip | wc -l`
|
2015-05-28 19:04:57 +02:00
|
|
|
Other=`egrep -i -v 'linux|MSWin32|darwin|freebsd|solaris|openbsd' stats_imapsync_${year}_${month}.ip |wc -l`
|
|
|
|
Nb_All=`cat stats_imapsync_${year}_${month}.ip | wc -l`
|
2012-12-29 01:43:39 +01:00
|
|
|
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD Other; do
|
2012-04-17 00:26:18 +02:00
|
|
|
#echo $OS `eval "echo \\$$OS"` / $Nb_All
|
|
|
|
Nb_OS=`eval "echo \\$$OS"`
|
|
|
|
PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l`
|
|
|
|
echo $OS $PerCent%
|
|
|
|
done
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_yearly_os 2012 # short"
|
2012-04-17 00:26:18 +02:00
|
|
|
statistics_VERSION_yearly_os() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2012-12-29 01:43:39 +01:00
|
|
|
Linux=`grep -i linux stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Win32=`grep -i MSWin32 stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Darwin=`grep -i darwin stats_imapsync_${year}.ip | wc -l`
|
|
|
|
FreeBSD=`grep -i freebsd stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Solaris=`grep -i solaris stats_imapsync_${year}.ip | wc -l`
|
|
|
|
OpenBSD=`grep -i openbsd stats_imapsync_${year}.ip | wc -l`
|
|
|
|
Other=`egrep -i -v 'linux|MSWin32|darwin|freebsd|solaris|openbsd' stats_imapsync_${year}.ip |wc -l`
|
2012-04-17 00:26:18 +02:00
|
|
|
Nb_All=`cat stats_imapsync_${year}.ip | wc -l`
|
2012-12-29 01:43:39 +01:00
|
|
|
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD Other; do
|
2012-04-17 00:26:18 +02:00
|
|
|
#echo $OS `eval "echo \\$$OS"` / $Nb_All
|
|
|
|
Nb_OS=`eval "echo \\$$OS"`
|
|
|
|
PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l`
|
|
|
|
echo $OS $PerCent %
|
|
|
|
done
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_monthly_ip_wc 02 2012 # short"
|
2011-07-11 23:24:12 +02:00
|
|
|
statistics_VERSION_monthly_ip_wc() {
|
2011-09-25 22:31:48 +02:00
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
2011-07-11 23:24:12 +02:00
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2012-04-17 00:30:19 +02:00
|
|
|
test -f stats_imapsync_${year}_${month}.ip || statistics_VERSION_monthly_ip $month ${year}
|
|
|
|
wc -l stats_imapsync_${year}_${month}.ip
|
2011-07-11 23:24:12 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_monthly_runs 02 2012 # short"
|
2011-07-11 23:24:12 +02:00
|
|
|
statistics_VERSION_monthly_runs() {
|
2011-09-25 22:31:48 +02:00
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
2011-07-11 23:24:12 +02:00
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2012-04-17 00:30:19 +02:00
|
|
|
wc -l access.log_${year}${month}??.imapsync_VERSION > stats_imapsync_${year}_${month}.runs
|
|
|
|
cat stats_imapsync_${year}_${month}.runs
|
2011-07-11 23:24:12 +02:00
|
|
|
)
|
|
|
|
}
|
2011-09-25 22:31:48 +02:00
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo
|
|
|
|
echo "statistics_VERSION_monthly 02 2012 # long, good choice"
|
2011-09-25 22:31:48 +02:00
|
|
|
statistics_VERSION_monthly() {
|
|
|
|
month=${1:-`date '+%m'`}
|
2012-04-17 00:30:19 +02:00
|
|
|
year=${2:-`date '+%Y'`}
|
2011-09-25 22:31:48 +02:00
|
|
|
(
|
|
|
|
statistics_VERSION_getstats
|
2012-04-17 00:30:19 +02:00
|
|
|
statistics_VERSION_monthly_ip $month $year
|
|
|
|
statistics_VERSION_monthly_runs $month $year
|
|
|
|
statistics_VERSION_monthly_ip_wc $month $year
|
2011-09-25 22:31:48 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
|
2015-12-03 18:16:32 +01:00
|
|
|
echo "statistics_VERSION_yearly_ip 2015 # very long"
|
2012-12-29 01:43:39 +01:00
|
|
|
statistics_VERSION_yearly_ip() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
statistics_VERSION_getstats
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2015-12-03 18:16:32 +01:00
|
|
|
cut -d ' ' -f 1,12,13,15,16,18,19 access.log_${year}????.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}.ip
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "statistics_VERSION_yearly_ip_resolved 2015 # very long"
|
|
|
|
statistics_VERSION_yearly_ip_resolved() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
today=`date +%Y_%m_%d`
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
mkdir -p daily
|
|
|
|
cat stats_imapsync_${year}.ip | awk '{ count=$1; ip=$2; $1=""; print $2 " " $0 " " count ; }' \
|
|
|
|
| webresolve > daily/stats_imapsync_${year}.ip.resolved.${today}.txt
|
2012-12-29 01:43:39 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2016-01-22 17:52:28 +01:00
|
|
|
|
|
|
|
maxmind_update() {
|
|
|
|
cat << 'EOF'
|
|
|
|
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
|
|
|
|
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
|
|
|
|
wget http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
|
|
|
|
gunzip GeoIP.dat.gz
|
|
|
|
gunzip GeoIPASNum.dat.gz
|
|
|
|
gunzip GeoLiteCity.dat.gz
|
|
|
|
sudo cp GeoIP.dat GeoIPASNum.dat GeoLiteCity.dat /usr/share/GeoIP/
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2015-12-03 18:16:32 +01:00
|
|
|
echo "statistics_VERSION_yearly_ip_geo 2015 # long"
|
|
|
|
statistics_VERSION_yearly_ip_geo() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
today=`date +%Y_%m_%d`
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
2016-01-22 17:52:28 +01:00
|
|
|
awk '{ print $2 }' stats_imapsync_${year}.ip | xargs -n1 geoiplookup > stats_imapsync_${year}.ipgeo.tmp.countries
|
|
|
|
awk '{ print $2 }' stats_imapsync_${year}.ip | xargs -n1 geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat > stats_imapsync_${year}.ipgeo.tmp.cities
|
|
|
|
cat stats_imapsync_${year}.ipgeo.tmp.countries stats_imapsync_${year}.ipgeo.tmp.cities | sort | uniq -c | sort -n > stats_imapsync_${year}.ipgeo
|
|
|
|
rm stats_imapsync_${year}.ipgeo.tmp.countries stats_imapsync_${year}.ipgeo.tmp.cities
|
|
|
|
echo stats_imapsync_${year}.ipgeo
|
2015-12-03 18:16:32 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "statistics_VERSION_all_years_ip_geo # long"
|
|
|
|
statistics_VERSION_all_years_ip_geo() {
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
2016-01-22 17:52:28 +01:00
|
|
|
awk '{ print $2 }' stats_imapsync_20??.ip | xargs -n1 geoiplookup > stats_imapsync_20xx.ipgeo.tmp.countries
|
|
|
|
awk '{ print $2 }' stats_imapsync_20??.ip | xargs -n1 geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat > stats_imapsync_20xx.ipgeo.tmp.cities
|
|
|
|
cat stats_imapsync_20xx.ipgeo.tmp.countries stats_imapsync_20xx.ipgeo.tmp.cities | sort | uniq -c | sort -n > stats_imapsync_20xx.ipgeo
|
|
|
|
rm stats_imapsync_20xx.ipgeo.tmp.countries stats_imapsync_20xx.ipgeo.tmp.cities
|
|
|
|
echo stats_imapsync_20xx.ipgeo
|
2015-12-03 18:16:32 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-06 00:26:28 +02:00
|
|
|
statistics_VERSION_yearly_runs() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2013-07-06 00:26:28 +02:00
|
|
|
test -f stats_imapsync_${year}.ip && cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-28 19:04:57 +02:00
|
|
|
statistics_releases_monthly() {
|
|
|
|
month=${1:-`date '+%m'`}
|
|
|
|
year=${2:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
test -f stats_imapsync_${year}_${month}.ip \
|
|
|
|
&& grep -o -P imapsync/'1\.\d{3}' stats_imapsync_${year}_${month}.ip \
|
|
|
|
| grep -o -P '1\.\d{3}' | sort -n | uniq -c | sort -n
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
statistics_releases_yearly() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
2015-12-03 18:16:32 +01:00
|
|
|
test -f stats_imapsync_${year}.ip \
|
|
|
|
&& grep -o -P imapsync/'1\.\d{3}' stats_imapsync_${year}.ip \
|
|
|
|
| grep -o -P '1\.\d{3}' | sort -n | uniq -c | sort -n
|
2015-05-28 19:04:57 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2015-12-03 18:16:32 +01:00
|
|
|
|
|
|
|
# releasecheck started on 1.349 in the imapsync code. date: 2010/09/06 00:25:03
|
2015-05-28 19:04:57 +02:00
|
|
|
# Disable releasecheck started on 1.584 on github Mar 5, 2014
|
|
|
|
# https://github.com/imapsync/imapsync/commits/master/imapsync
|
|
|
|
statistics_releases_all_times() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
2015-12-03 18:16:32 +01:00
|
|
|
grep -h -o -P imapsync/'1\.\d{3}' stats_imapsync_20??.ip \
|
|
|
|
| grep -o -P '1\.\d{3}' | sort -n | uniq -c | sort -n
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
statistics_perl_monthly() {
|
|
|
|
month=${1:-`date '+%m'`}
|
|
|
|
year=${2:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
test -f stats_imapsync_${year}_${month}.ip \
|
|
|
|
&& grep -o -P 'perl ''(\.|\d)+' stats_imapsync_${year}_${month}.ip \
|
|
|
|
| grep -o -P '(\.|\d)+' | sort -n | uniq -c | sort -n
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
statistics_perl_yearly() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
test -f stats_imapsync_${year}.ip \
|
|
|
|
&& grep -o -P 'perl ''(\.|\d)+' stats_imapsync_${year}.ip \
|
|
|
|
| grep -o -P '(\.|\d)+' | sort -n | uniq -c | sort -n
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2016-01-22 17:52:28 +01:00
|
|
|
statistics_perl_all_times() {
|
2015-12-03 18:16:32 +01:00
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
ls -d stats_imapsync_????.ip > /dev/null || return
|
|
|
|
grep -h -o -P 'perl ''(\.|\d)+' stats_imapsync_20??.ip \
|
|
|
|
| grep -o -P '(\.|\d)+' | sort -n | uniq -c | sort -nr
|
2015-05-28 19:04:57 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2016-01-22 17:52:28 +01:00
|
|
|
echo statistics_Mail_IMAPClient_monthly
|
|
|
|
statistics_Mail_IMAPClient_monthly() {
|
|
|
|
month=${1:-`date '+%m'`}
|
|
|
|
year=${2:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
test -f stats_imapsync_${year}_${month}.ip \
|
|
|
|
&& grep -o -P ', ''(\.|\d)+' stats_imapsync_${year}_${month}.ip \
|
|
|
|
| grep -o -P '(\.|\d)+' | sort -n | uniq -c | sort -n
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
echo statistics_Mail_IMAPClient_yearly
|
|
|
|
statistics_Mail_IMAPClient_yearly() {
|
|
|
|
year=${1:-`date '+%Y'`}
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
test -f stats_imapsync_${year}.ip \
|
|
|
|
&& grep -o -P ', ''(\.|\d)+' stats_imapsync_${year}.ip \
|
|
|
|
| grep -o -P '(\.|\d)+' | sort -n | uniq -c | sort -n
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
statistics_Mail_IMAPClient_all_times() {
|
|
|
|
(
|
|
|
|
cd $HOME/imapsync_stats
|
|
|
|
ls -d stats_imapsync_????.ip > /dev/null || return
|
|
|
|
grep -h -o -P ', ''(\.|\d)+' stats_imapsync_20??.ip \
|
|
|
|
| grep -o -P '(\.|\d)+' | sort -n | uniq -c | sort -n
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2015-05-28 19:04:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-06 00:26:28 +02:00
|
|
|
|
2015-12-03 18:16:32 +01:00
|
|
|
|
2012-12-29 01:43:39 +01:00
|
|
|
echo "statistics_VERSION_synthesis 2012 # short"
|
2011-09-25 22:31:48 +02:00
|
|
|
statistics_VERSION_synthesis() {
|
2012-04-17 00:26:18 +02:00
|
|
|
year=${1:-`date '+%Y'`}
|
2015-05-28 19:04:57 +02:00
|
|
|
year_now=`date '+%Y'`
|
2011-09-25 22:31:48 +02:00
|
|
|
(
|
2013-12-30 03:03:13 +01:00
|
|
|
cd $HOME/imapsync_stats
|
2015-05-28 19:04:57 +02:00
|
|
|
echo && echo "==== Nb users each month in ${year} "
|
2012-04-17 00:26:18 +02:00
|
|
|
wc -l stats_imapsync_${year}_??.ip
|
2015-05-28 19:04:57 +02:00
|
|
|
echo && echo "==== Nb runs each month in ${year} "
|
|
|
|
for f in stats_imapsync_${year}_??.runs; do
|
|
|
|
test -f $f && echo -n "$f : " && tail -n 1 $f
|
|
|
|
done
|
|
|
|
echo && echo "==== % Operating systems in ${year} "
|
2012-04-17 00:26:18 +02:00
|
|
|
statistics_VERSION_yearly_os $year
|
2015-12-03 18:16:32 +01:00
|
|
|
echo && echo "==== Perl releases in ${year} "
|
|
|
|
statistics_perl_yearly $year | tail -9
|
2015-05-28 19:04:57 +02:00
|
|
|
echo && echo "==== Biggest users in ${year} "
|
|
|
|
tail -n 9 stats_imapsync_${year}.ip
|
|
|
|
echo && echo "==== Most releases used in ${year} "
|
|
|
|
statistics_releases_yearly ${year} | tail -9
|
|
|
|
echo && echo "==== Nb users each year "
|
2013-07-06 00:26:28 +02:00
|
|
|
wc -l stats_imapsync_????.ip
|
2015-05-28 19:04:57 +02:00
|
|
|
echo && echo "==== Nb runs each year : "
|
|
|
|
for yyyy in `count_nice 2011 ${year_now}`; do
|
2013-07-06 00:26:28 +02:00
|
|
|
echo -n "$yyyy: "
|
|
|
|
statistics_VERSION_yearly_runs $yyyy
|
|
|
|
done
|
2015-08-04 03:44:40 +02:00
|
|
|
nb_runs_current_year=`statistics_VERSION_yearly_runs $year_now`
|
|
|
|
current_day_of_year=`date +%j`
|
|
|
|
echo; echo -n "$year_now~~"
|
|
|
|
echo "$nb_runs_current_year/$current_day_of_year*365" | bc
|
2011-09-25 22:31:48 +02:00
|
|
|
)
|
|
|
|
}
|
2012-12-29 01:43:39 +01:00
|
|
|
|
2015-12-03 18:16:32 +01:00
|
|
|
|
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
}
|
|
|
|
|
2015-05-28 19:04:57 +02:00
|
|
|
test X"`hostname`" = Xks2 && statistics_VERSION_ks
|
|
|
|
test X"`hostname`" = Xtuxinette && statistics_VERSION_lfo
|
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
|
2011-03-12 03:43:54 +01:00
|
|
|
niouzes_compil() {
|
2011-03-12 03:45:04 +01:00
|
|
|
(
|
|
|
|
cd /g/public_html/www.linux-france.org/html/
|
2011-03-12 03:43:54 +01:00
|
|
|
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
|
2011-03-12 03:45:04 +01:00
|
|
|
)
|
2011-03-12 03:43:54 +01:00
|
|
|
}
|
|
|
|
|
2011-03-12 03:44:35 +01:00
|
|
|
|
|
|
|
|
2011-03-12 03:43:54 +01:00
|
|
|
lfo_announce() {
|
|
|
|
software_version
|
2011-03-12 03:45:04 +01:00
|
|
|
NEWS_FILE="/g/public_html/www.linux-france.org/html/niouzes/niouzes_imapsync.xml"
|
2011-03-12 03:43:54 +01:00
|
|
|
if ! newer VERSION $NEWS_FILE; then
|
|
|
|
echo "$VERSION already announced"
|
|
|
|
else
|
2011-03-12 03:43:55 +01:00
|
|
|
cat > $NEWS_FILE << EOF
|
2011-03-12 03:43:54 +01:00
|
|
|
|
|
|
|
<news date="`date '+%Y%m%d'`">
|
2011-03-12 03:44:35 +01:00
|
|
|
`LANG=fr_FR date '+%A %d %B %Y'` : Synchronisez ou migrez vos boites
|
2015-12-03 18:16:32 +01:00
|
|
|
aux lettres avec \E9conomie et l'outil <A
|
2011-03-12 03:43:54 +01:00
|
|
|
HREF="prj/imapsync/">imapsync $VERSION</A> (Gilles LAMIRAL)
|
|
|
|
</news>
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
niouzes_compil
|
|
|
|
}
|
|
|
|
|
2011-03-12 03:44:49 +01:00
|
|
|
#' nedit sucks with syntax color
|
2011-03-12 03:44:27 +01:00
|
|
|
|
2011-03-12 03:44:35 +01:00
|
|
|
fm_init() {
|
2011-03-12 03:44:21 +01:00
|
|
|
software_version
|
2011-03-12 03:44:49 +01:00
|
|
|
NEWS_FILE_FM="./freshmeat_submition"
|
2011-03-12 03:44:27 +01:00
|
|
|
NEWS_FILE_FM_INP=${NEWS_FILE_FM}.inp
|
2011-03-12 03:45:02 +01:00
|
|
|
NEWS_FILE_FM_OUT=${NEWS_FILE_FM}.json
|
2011-03-12 03:44:35 +01:00
|
|
|
}
|
2011-03-12 03:44:27 +01:00
|
|
|
|
2011-03-12 03:44:49 +01:00
|
|
|
fm_read_param() {
|
|
|
|
# read definitions
|
|
|
|
. $NEWS_FILE_FM_INP
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:35 +01:00
|
|
|
fm_read_announce() {
|
|
|
|
|
2011-03-12 03:44:49 +01:00
|
|
|
fm_init
|
|
|
|
fm_read_param
|
2011-03-12 03:44:35 +01:00
|
|
|
|
2011-03-12 03:44:49 +01:00
|
|
|
cat << EOF
|
2011-03-12 03:45:02 +01:00
|
|
|
{
|
|
|
|
"release": {
|
|
|
|
"tag_list": "stable, $RELEASE_FOCUS",
|
|
|
|
"version": "$VERSION",
|
|
|
|
"hidden_from_frontpage": false,
|
|
|
|
"changelog": "$TEXT_BODY"
|
|
|
|
}
|
|
|
|
}
|
2011-03-12 03:44:27 +01:00
|
|
|
|
2011-03-12 03:44:21 +01:00
|
|
|
EOF
|
2011-03-12 03:44:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fm_announce() {
|
2011-03-12 03:44:49 +01:00
|
|
|
fm_init
|
2011-03-12 03:44:35 +01:00
|
|
|
|
2011-03-12 03:44:49 +01:00
|
|
|
if ! newer VERSION $NEWS_FILE_FM_OUT; then
|
2011-03-12 03:44:35 +01:00
|
|
|
echo "$VERSION already submitted on freshmeat"
|
2011-03-12 03:44:49 +01:00
|
|
|
else
|
2011-03-12 03:44:35 +01:00
|
|
|
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
|
2011-03-12 03:45:02 +01:00
|
|
|
curl -X PUT -d @../../var/pass/secret.freshmeat -d @$NEWS_FILE_FM_OUT \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
http://freshmeat.net/projects/imapsync.json
|
|
|
|
|
2011-03-12 03:44:49 +01:00
|
|
|
fi
|
2011-03-12 03:44:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|