Skip to content

Commit

Permalink
Merge pull request #33 from snaptec/master
Browse files Browse the repository at this point in the history
releastetrain
  • Loading branch information
snaptec authored Nov 7, 2018
2 parents 13a4872 + ccff4d8 commit 06f894d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
6 changes: 3 additions & 3 deletions openwb.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ nachtsoc=15
nachtsoc1=15
mindestuberschuss=1500
abschaltuberschuss=5
sofortll=32
sofortll=27
sofortlls1=32
sofortlls2=13
smaemdbezugid=1900123456
Expand Down Expand Up @@ -109,7 +109,7 @@ evsewifitimeoutlp2=1
evsewifiiplp1=10.20.0.98
evsewifitimeoutlp1=1
nachtladenabs1=18
sofortsoclp1=45
sofortsoclp1=65
sofortsoclp2=80
sofortsoclp3=
sofortsocstatlp1=1
Expand Down Expand Up @@ -167,4 +167,4 @@ speicherleistung_http='http://10.20.0.63/haus/ramdisk/battleistung'
[email protected]
soc_tesla_password=deinpasswort
soc_tesla_intervall=15

releasetrain=stable
7 changes: 6 additions & 1 deletion runs/atreboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,10 @@ if ! grep -Fq "soc_tesla_intervall=" /var/www/html/openWB/openwb.conf
then
echo "soc_tesla_intervall=20" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "releasetrain=" /var/www/html/openWB/openwb.conf
then
echo "releasetrain=stable" >> /var/www/html/openWB/openwb.conf
fi
if ! sudo grep -Fq "cronnightly.sh" /var/spool/cron/crontabs/pi
then
(crontab -l -u pi ; echo "1 0 * * * /var/www/html/openWB/runs/cronnightly.sh >> /var/log/openWB.log 2>&1")| crontab -u pi -
Expand All @@ -559,4 +562,6 @@ fi


sudo cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
uuid=$(uuid)
curl -d "update="$uuid"" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://openwb.de/tools/update.php
sudo i2cdetect -y 1 | grep -o ' .. --' |grep -o '[0-9]*' > /var/www/html/openWB/ramdisk/i2csearch
3 changes: 2 additions & 1 deletion runs/update.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

cd /var/www/html/openWB
. /var/www/html/openWB/openwb.conf
cp modules/soc_i3/auth.json /tmp/auth.json
cp modules/soc_i3s1/auth.json /tmp/auth.json.1
cp openwb.conf /tmp/openwb.conf
Expand All @@ -10,7 +11,7 @@ cp web/logging/data/daily/* /tmp/data/daily
mkdir /tmp/data/monthly
cp web/logging/data/monthly/* /tmp/data/monthly
sudo git fetch origin
sudo git reset --hard origin/master
sudo git reset --hard origin/$releasetrain
cd /var/www/html/
sudo chown -R pi:pi openWB
sudo chown -R www-data:www-data /var/www/html/openWB/web/backup
Expand Down
19 changes: 17 additions & 2 deletions web/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@
if(strpos($line, "livegraph=") !== false) {
list(, $livegraphold) = explode("=", $line);
}

if(strpos($line, "releasetrain=") !== false) {
list(, $releasetrainold) = explode("=", $line);
}
}

$bezug_http_w_urlold = str_replace( "'", "", $bezug_http_w_urlold);
Expand Down Expand Up @@ -392,8 +394,21 @@
<option <?php if($livegraphold == 20) echo selected ?> value="20">20 Min</option>
<option <?php if($livegraphold == 30) echo selected ?> value="30">30 Min</option>
</select><br>

<br>
</div>
<div class="row">
<b><label for="releasetrain">Releasechannel:</label></b>
<select type="text" name="releasetrain" id="releasetrain">
<option <?php if($releasetrainold == "stable\n") echo selected ?>value="stable">Stable</option>
<option <?php if($releasetrainold == "beta\n") echo selected ?> value="beta">Beta</option>
<option <?php if($releasetrainold == "master\n") echo selected ?> value="master">Nightly</option>
</select>
<br>
</div>
<div class="row">
Der Stable train ist der empfohlene. Im Betazweig befinden sich die Änderungen für künftige Releases. Nightly ist der aktuelle Entwicklungszweig. Man kann grundsätzlich immer zwischen den Zweigen wechseln. Hierfür den gewünschten Zweig auswählen, Speichern und ein Update durchführen.<br><br>
</div>

<br><br>
<button type="submit" class="btn btn-primary btn-green">Save</button>
</form><br><br /><hr>
Expand Down
12 changes: 12 additions & 0 deletions web/tools/savemisc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
}
}
file_put_contents('/var/www/html/openWB/openwb.conf', $result);
$result = '';
$lines = file('/var/www/html/openWB/openwb.conf');
foreach($lines as $line) {
if(strpos($line, "releasetrain=") !== false) {
$result .= 'releasetrain='.$_POST[releasetrain]."\n";
}
else {
$result .= $line;
}
}
file_put_contents('/var/www/html/openWB/openwb.conf', $result);



}
Expand Down

0 comments on commit 06f894d

Please sign in to comment.