Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
164169e375 | ||
|
|
37a6c58b5a | ||
|
|
a34c1cd856 | ||
|
|
02cde84392 |
@@ -1,3 +1,12 @@
|
|||||||
|
## 0.4.3 - 17/06/2017
|
||||||
|
Fix path of sed in lock function
|
||||||
|
|
||||||
|
## 0.4.2 - 16/06/2017
|
||||||
|
Fix another problem on generate installation identifier to sendo for statistic
|
||||||
|
|
||||||
|
## 0.4.1 - 14/06/2017
|
||||||
|
Fix problem on send identifier installation for statistic
|
||||||
|
|
||||||
## 0.4.0 - 14/06/2017
|
## 0.4.0 - 14/06/2017
|
||||||
Add credentials support to socket server (define TCPSERVER_USER and TCPSERVER_PWD in your config file)
|
Add credentials support to socket server (define TCPSERVER_USER and TCPSERVER_PWD in your config file)
|
||||||
Add management lock/unlock for prevent concurrente call to open/close solenoid
|
Add management lock/unlock for prevent concurrente call to open/close solenoid
|
||||||
|
|||||||
15
piGarden.sh
15
piGarden.sh
@@ -1418,7 +1418,7 @@ list_descendants ()
|
|||||||
#
|
#
|
||||||
function lock {
|
function lock {
|
||||||
|
|
||||||
sleep 0.$((100 * $RANDOM / 32767)) | sed 's/..$/.&/'
|
sleep 0.$((100 * $RANDOM / 32767)) | $SED 's/..$/.&/'
|
||||||
|
|
||||||
local max_time=10
|
local max_time=10
|
||||||
local current_time=$(($1 + 1))
|
local current_time=$(($1 + 1))
|
||||||
@@ -1464,20 +1464,23 @@ function send_identifier {
|
|||||||
local FILE_ID="/tmp/pigarden.id"
|
local FILE_ID="/tmp/pigarden.id"
|
||||||
|
|
||||||
if [ -f "$FILE_ID" ]; then
|
if [ -f "$FILE_ID" ]; then
|
||||||
# Se il file è più vecchio di un giorno esce
|
# Se il file non è più vecchio di un giorno esce
|
||||||
local max_age_file=86400
|
local max_age_file=86400
|
||||||
local time_file=`$STAT -c %Y "$FILE_ID"`
|
local time_file=`$STAT -c %Y "$FILE_ID"`
|
||||||
local age_file=$((`date +"%s"` - $time_file ))
|
local age_file=$((`date +"%s"` - $time_file ))
|
||||||
|
#log_write "age_file=$age_file - max_age_file=$max_age_file"
|
||||||
if [ "$age_file" -lt "$max_age_file" ]; then
|
if [ "$age_file" -lt "$max_age_file" ]; then
|
||||||
|
#log_write "Id troppo giovane ($age_file) esce e non esegue l'invio"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
else
|
fi
|
||||||
local ID=`ifconfig | $GREP --color=never -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | head -1 | md5sum | $CUT -d" " -f 1`
|
local ID=`/sbin/ifconfig | $GREP --color=never -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | /usr/bin/head -1 | /usr/bin/md5sum | $CUT -d" " -f 1`
|
||||||
if [ -z "$ID" ]; then
|
if [ -z "$ID" ]; then
|
||||||
return;
|
return;
|
||||||
fi
|
fi
|
||||||
echo "$ID" > "$FILE_ID"
|
echo "$ID" > "$FILE_ID"
|
||||||
fi
|
|
||||||
|
log_write "Send installation identifier to collect usage"
|
||||||
|
|
||||||
$CURL https://www.lejubila.net/statistic/collect_usage/piGarden/$ID/$VERSION/$SUB_VERSION/$RELEASE_VERSION > /dev/null 2>&1
|
$CURL https://www.lejubila.net/statistic/collect_usage/piGarden/$ID/$VERSION/$SUB_VERSION/$RELEASE_VERSION > /dev/null 2>&1
|
||||||
|
|
||||||
@@ -1493,7 +1496,7 @@ function debug2 {
|
|||||||
|
|
||||||
VERSION=0
|
VERSION=0
|
||||||
SUB_VERSION=4
|
SUB_VERSION=4
|
||||||
RELEASE_VERSION=0
|
RELEASE_VERSION=3
|
||||||
|
|
||||||
DIR_SCRIPT=`dirname $0`
|
DIR_SCRIPT=`dirname $0`
|
||||||
NAME_SCRIPT=${0##*/}
|
NAME_SCRIPT=${0##*/}
|
||||||
|
|||||||
Reference in New Issue
Block a user