Merge remote-tracking branch 'origin/master' into prod

* origin/master:
  Only show new medal requirements
  remove failed captures (avoids loop when it's the newest file)
  Add / Update copyright notices
  Use rrdcreate() everywhere
This commit is contained in:
Vincent Riquer 2015-02-10 14:50:19 +01:00
commit 5a14e0a099
21 changed files with 306 additions and 101 deletions

2
add
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/) # IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014 Vincent Riquer # Copyright (C) 2014-2015 Vincent Riquer
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/) # IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014 Vincent Riquer # Copyright (C) 2014-2015 Vincent Riquer
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -42,48 +42,10 @@ cat <<-EOHTML
EOHTML EOHTML
if ! [ -w "$rrdfile" ] if ! [ -w "$rrdfile" ]
then then
rrdtool create ingress.rrd -s $((60*60)) \ rrdcreate || {
DS:AP:GAUGE:$((2*24*60*60)):0:NaN \
DS:Explorer:GAUGE:$((48*60*60)):0:NaN \
DS:Seer:GAUGE:$((48*60*60)):0:NaN \
DS:XM:GAUGE:$((48*60*60)):0:NaN \
DS:Hacker:GAUGE:$((48*60*60)):0:NaN \
DS:Builder:GAUGE:$((48*60*60)):0:NaN \
DS:Connector:GAUGE:$((48*60*60)):0:NaN \
DS:Mind_Controller:GAUGE:$((48*60*60)):0:NaN \
DS:MU:GAUGE:$((48*60*60)):0:NaN \
DS:Longest_Link:GAUGE:$((48*60*60)):0:NaN \
DS:Largest_Field:GAUGE:$((48*60*60)):0:NaN \
DS:Recharger:GAUGE:$((48*60*60)):0:NaN \
DS:Liberator:GAUGE:$((48*60*60)):0:NaN \
DS:Pioneer:GAUGE:$((48*60*60)):0:NaN \
DS:Purifier:GAUGE:$((48*60*60)):0:NaN \
DS:Neutralized:GAUGE:$((48*60*60)):0:NaN \
DS:Links_Destroyed:GAUGE:$((48*60*60)):0:NaN \
DS:Fields_Destroyed:GAUGE:$((48*60*60)):0:NaN \
DS:Walked:GAUGE:$((48*60*60)):0:NaN \
DS:Guardian:GAUGE:$((48*60*60)):0:NaN \
DS:Link_Maintained:GAUGE:$((48*60*60)):0:NaN \
DS:Link_Length_x_Days:GAUGE:$((48*60*60)):0:NaN \
DS:Field_Held:GAUGE:$((48*60*60)):0:NaN \
DS:Field_x_Days:GAUGE:$((48*60*60)):0:NaN \
DS:Mercenary:GAUGE:$((48*60*60)):0:NaN \
DS:Engineer:GAUGE:$((48*60*60)):0:NaN \
DS:Recruiter:GAUGE:$((48*60*60)):0:NaN \
DS:Translator:GAUGE:$((48*60*60)):0:NaN \
DS:Hackaton:GAUGE:$((48*60*60)):0:NaN \
RRA:HWPREDICT:8760:8e-1:8e-1:$((24)) \
RRA:AVERAGE:99e-2:1:$((24*15)) \
RRA:MAX:99e-2:1:$((24*15)) \
RRA:AVERAGE:99e-2:4:$((24*180)) \
RRA:MAX:99e-2:4:$((24*180)) \
RRA:AVERAGE:99e-2:24:$(((4*365)+1)) \
RRA:MAX:99e-2:24:$(((4*365)+1)) \
RRA:AVERAGE:99e-2:$((24*30)):$(((32*365)+8)) \
RRA:MAX:99e-2:$((24*30)):$(((32*365)+8)) \
|| {
cat <<-EOHTML cat <<-EOHTML
<h1 style="color:red">Cannot create $rrdfile</h1> <h1 style="color:red">Cannot create $rrdfile</h1>
</div>
</body> </body>
</html> </html>
EOHTML EOHTML

43
import
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/) # IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014 Vincent Riquer # Copyright (C) 2014-2015 Vincent Riquer
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -101,46 +101,7 @@ else
EOHTML EOHTML
if ! [ -w "$rrdfile" ] if ! [ -w "$rrdfile" ]
then then
rrdtool create "$rrdfile" -s $((60*60)) \ rrdcreate || {
DS:AP:GAUGE:$((2*24*60*60)):0:NaN \
DS:Explorer:GAUGE:$((48*60*60)):0:NaN \
DS:Seer:GAUGE:$((48*60*60)):0:NaN \
DS:XM:GAUGE:$((48*60*60)):0:NaN \
DS:Hacker:GAUGE:$((48*60*60)):0:NaN \
DS:Builder:GAUGE:$((48*60*60)):0:NaN \
DS:Connector:GAUGE:$((48*60*60)):0:NaN \
DS:Mind_Controller:GAUGE:$((48*60*60)):0:NaN \
DS:MU:GAUGE:$((48*60*60)):0:NaN \
DS:Longest_Link:GAUGE:$((48*60*60)):0:NaN \
DS:Largest_Field:GAUGE:$((48*60*60)):0:NaN \
DS:Recharger:GAUGE:$((48*60*60)):0:NaN \
DS:Liberator:GAUGE:$((48*60*60)):0:NaN \
DS:Pioneer:GAUGE:$((48*60*60)):0:NaN \
DS:Purifier:GAUGE:$((48*60*60)):0:NaN \
DS:Neutralized:GAUGE:$((48*60*60)):0:NaN \
DS:Links_Destroyed:GAUGE:$((48*60*60)):0:NaN \
DS:Fields_Destroyed:GAUGE:$((48*60*60)):0:NaN \
DS:Walked:GAUGE:$((48*60*60)):0:NaN \
DS:Guardian:GAUGE:$((48*60*60)):0:NaN \
DS:Link_Maintained:GAUGE:$((48*60*60)):0:NaN \
DS:Link_Length_x_Days:GAUGE:$((48*60*60)):0:NaN \
DS:Field_Held:GAUGE:$((48*60*60)):0:NaN \
DS:Field_x_Days:GAUGE:$((48*60*60)):0:NaN \
DS:Mercenary:GAUGE:$((48*60*60)):0:NaN \
DS:Engineer:GAUGE:$((48*60*60)):0:NaN \
DS:Recruiter:GAUGE:$((48*60*60)):0:NaN \
DS:Translator:GAUGE:$((48*60*60)):0:NaN \
DS:Hackaton:GAUGE:$((48*60*60)):0:NaN \
RRA:HWPREDICT:8760:8e-1:8e-1:$((24)) \
RRA:AVERAGE:99e-2:1:$((24*15)) \
RRA:MAX:99e-2:1:$((24*15)) \
RRA:AVERAGE:99e-2:4:$((24*180)) \
RRA:MAX:99e-2:4:$((24*180)) \
RRA:AVERAGE:99e-2:24:$(((4*365)+1)) \
RRA:MAX:99e-2:24:$(((4*365)+1)) \
RRA:AVERAGE:99e-2:$((24*30)):$(((32*365)+8)) \
RRA:MAX:99e-2:$((24*30)):$(((32*365)+8)) \
|| {
cat <<-EOHTML cat <<-EOHTML
<h1 style="color:red">Cannot create $rrdfile</h1> <h1 style="color:red">Cannot create $rrdfile</h1>
</body> </body>

46
index
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/) # IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014 Vincent Riquer # Copyright (C) 2014-2015 Vincent Riquer
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -174,8 +174,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextsilver[timestamp]} for stat in ${nextsilver[timestamp]}
do do
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} silver)" ) if ! (( shown["$stat silver"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat silver"]=1
fi
(( ++count == lvlsilver[level] - silvercount )) && break 2 (( ++count == lvlsilver[level] - silvercount )) && break 2
done done
fi fi
@ -184,8 +188,12 @@ then
do do
(( count >= lvlsilver[level] - silvercount )) && break 1 (( count >= lvlsilver[level] - silvercount )) && break 1
(( count < lvlsilver[level] - silvercount )) && never=1 (( count < lvlsilver[level] - silvercount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} silver)" ) if ! (( shown["$stat silver"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat silver"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )
@ -205,8 +213,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextgold[timestamp]} for stat in ${nextgold[timestamp]}
do do
if ! (( shown["$stat gold"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" ) tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat gold"]=1
fi
(( ++count == lvlgold[level] - goldcount )) && break 2 (( ++count == lvlgold[level] - goldcount )) && break 2
done done
fi fi
@ -215,8 +227,12 @@ then
do do
(( count >= lvlgold[level] - goldcount )) && break 1 (( count >= lvlgold[level] - goldcount )) && break 1
(( count < lvlgold[level] - goldcount )) && never=1 (( count < lvlgold[level] - goldcount )) && never=1
if ! (( shown["$stat gold"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" ) tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat gold"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )
@ -236,8 +252,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextplatinum[timestamp]} for stat in ${nextplatinum[timestamp]}
do do
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} platinum)" ) if ! (( shown["$stat platinum"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat platinum"]=1
fi
(( ++count == lvlplatinum[level] - platinumcount )) && break 2 (( ++count == lvlplatinum[level] - platinumcount )) && break 2
done done
fi fi
@ -246,8 +266,12 @@ then
do do
(( count >= lvlplatinum[level] - platinumcount )) && break 1 (( count >= lvlplatinum[level] - platinumcount )) && break 1
(( count < lvlplatinum[level] - platinumcount )) && never=1 (( count < lvlplatinum[level] - platinumcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} platinum)" ) if ! (( shown["$stat platinum"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat platinum"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )
@ -267,8 +291,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextblack[timestamp]} for stat in ${nextblack[timestamp]}
do do
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} black)" ) if ! (( shown["$stat black"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat black"]=1
fi
(( ++count == lvlblack[level] - blackcount )) && break 2 (( ++count == lvlblack[level] - blackcount )) && break 2
done done
fi fi
@ -277,8 +305,12 @@ then
do do
(( count >= lvlblack[level] - blackcount )) && break 1 (( count >= lvlblack[level] - blackcount )) && break 1
(( count < lvlblack[level] - blackcount )) && never=1 (( count < lvlblack[level] - blackcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} black)" ) if ! (( shown["$stat black"] ))
then
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} gold)" )
tableline+=( '<br />' ) tableline+=( '<br />' )
shown["$stat black"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )

View File

@ -1,5 +1,22 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd"> <!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!--
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<!-- Round Robin Database Dump --> <!-- Round Robin Database Dump -->
<rrd> <rrd>
<version>0003</version> <version>0003</version>

View File

@ -1,6 +1,6 @@
/* /*
* IngRRD (https://forge.riquer.fr/p/ingrrd/) * IngRRD (https://forge.riquer.fr/p/ingrrd/)
* Copyright (C) 2014 Vincent Riquer * Copyright (C) 2014-2015 Vincent Riquer
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
get_current_level() { get_current_level() {
for level in {1..16} for level in {1..16}
do do

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
get_next_level() { get_next_level() {
local level local level
next=() next=()

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
declare -A \ declare -A \
last \ last \
nosilver \ nosilver \
@ -17,6 +33,7 @@ declare -A \
hasplatinum \ hasplatinum \
hasblack \ hasblack \
first \ first \
shown \
declare -a \ declare -a \
bronzes \ bronzes \

View File

@ -44,6 +44,8 @@ image() {
case "$line" in case "$line" in
'Error, please try again.') 'Error, please try again.')
# Ingress failed when generating image, ignore file. # Ingress failed when generating image, ignore file.
echo $'\tFailed capture, file removed.'
rm "$1"
return 3 return 3
;; ;;
#14,522,411 AP 144mm AP #14,522,411 AP 144mm AP

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import_images() { import_images() {
local starttime=$(date +%s) imagetime timestamp elapsed lasttime now local starttime=$(date +%s) imagetime timestamp elapsed lasttime now
exec >> images.log exec >> images.log

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
medals() { medals() {
local \ local \
stat \ stat \

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
print_medal() { print_medal() {
local \ local \
timestamp=$1 \ timestamp=$1 \

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
read_query_string() { read_query_string() {
local \ local \
exprgraph \ exprgraph \

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
readlast() { readlast() {
local \ local \
index \ index \

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
readold() { readold() {
local when=$1 \ local when=$1 \
line \ line \

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
rrdcreate() { rrdcreate() {
rrdtool restore ingress.xml "$rrdfile" rrdtool restore ingress.xml "$rrdfile"
} }

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
send_headers() { send_headers() {
local timestamp do_exit header thisdate expiredate local timestamp do_exit header thisdate expiredate
read timestamp < <(stat -c %Y $0 settings "$rrdfile" lib/* .importing 2>/dev/null|sort -r) read timestamp < <(stat -c %Y $0 settings "$rrdfile" lib/* .importing 2>/dev/null|sort -r)

View File

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
show_current_level() { show_current_level() {
cat <<-EOHTML cat <<-EOHTML
<table class="curlevel" style="width:$(( graph_width + 97 ))px"> <table class="curlevel" style="width:$(( graph_width + 97 ))px">

View File

@ -1,3 +1,19 @@
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;

View File

@ -1,3 +1,19 @@
# IngRRD (https://forge.riquer.fr/p/ingrrd/)
# Copyright (C) 2014-2015 Vincent Riquer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Path to your fastcgi_cache (optional). # Path to your fastcgi_cache (optional).
CACHE_DIR=/web/ingress-stats.riquer.fr/cache/ CACHE_DIR=/web/ingress-stats.riquer.fr/cache/
@ -224,3 +240,9 @@ silver["Translator"]=2000
gold["Translator"]=6000 gold["Translator"]=6000
platinum["Translator"]=20000 platinum["Translator"]=20000
black["Translator"]=50000 black["Translator"]=50000
#bronze[""]=
#silver[""]=
#gold[""]=
#platinum[""]=
#black[""]=