Skip to content

Commit

Permalink
soc_smarteq: remove entries from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
rleidner committed Jan 6, 2025
1 parent da5fb0b commit de2f394
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions runs/updateConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,6 @@ updateConfig(){
if ! grep -Fq "soc_ovms_intervall=" $ConfigFile; then
echo "soc_ovms_intervall=120" >> $ConfigFile
fi
if ! grep -Fq "soc_smarteq_intervallladen=" $ConfigFile; then
echo "soc_smarteq_intervallladen=20" >> $ConfigFile
fi
if ! grep -Fq "soc_smarteq_intervall=" $ConfigFile; then
echo "soc_smarteq_intervall=120" >> $ConfigFile
fi
if ! grep -Fq "releasetrain=" $ConfigFile; then
echo "releasetrain=stable" >> $ConfigFile
fi
Expand Down Expand Up @@ -1707,9 +1701,6 @@ updateConfig(){
if ! grep -Fq "soc2pin=" $ConfigFile; then
echo "soc2pin=pin" >> $ConfigFile
fi
if ! grep -Fq "soc2pint=" $ConfigFile; then
echo "soc2pint=''" >> $ConfigFile
fi
if ! grep -Fq "lgessv1ip=" $ConfigFile; then
echo "lgessv1ip=youripaddress" >> $ConfigFile
fi
Expand Down Expand Up @@ -2138,22 +2129,6 @@ updateConfig(){
if ! grep -Fq "soc_ovms_vehicleid=" $ConfigFile; then
echo "soc_ovms_vehicleid=vehicleid" >> $ConfigFile
fi
if ! grep -Fq "soc_smarteq_username=" $ConfigFile; then
echo "soc_smarteq_username=User" >> $ConfigFile
fi
if ! grep -Fq "soc_smarteq_passwort=" $ConfigFile; then
echo "soc_smarteq_passwort=''" >> $ConfigFile
else
sed -i "/soc_smarteq_passwort='/b; s/^soc_smarteq_passwort=\(.*\)/soc_smarteq_passwort=\'\1\'/g" $ConfigFile
fi
if ! grep -Fq "soc_smarteq_pin=" $ConfigFile; then
echo "soc_smarteq_pin=''" >> $ConfigFile
else
sed -i "/soc_smarteq_pin='/b; s/^soc_smarteq_pin=\(.*\)/soc_smarteq_pin=\'\1\'/g" $ConfigFile
fi
if ! grep -Fq "soc_smarteq_vin=" $ConfigFile; then
echo "soc_smarteq_vin=VIN" >> $ConfigFile
fi
if ! grep -Fq "soc2vin=" $ConfigFile; then
echo "soc2vin=" >> $ConfigFile
echo "soc2intervall=60" >> $ConfigFile
Expand Down Expand Up @@ -2404,5 +2379,32 @@ updateConfig(){
fi
fi
fi
echo "remove soc_smarteq entries from Config file"
cp $ConfigFile $ConfigFile.tmp
# check for socmodul1=soc_smarteqlp2
ism2=`grep "socmodul1=soc_smarteqlp2" $ConfigFile.tmp | wc -l | awk '{print $1}'`
if [ $ism2 -ne 0 ]
then
echo "soc_smarteq found configured as socmodul1 - cleanup soc2 entries"

Check failure on line 2388 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
sed -e "

Check failure on line 2389 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
s/soc2user=.*$/soc2user=demo@demo.de/

Check failure on line 2390 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
s/soc2pass=.*$/soc2pass=\'\'/

Check failure on line 2391 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
s/soc2pin=.*$/soc2pin=pin/

Check failure on line 2392 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
s/soc2vin=.*$/soc2vin=/

Check failure on line 2393 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
s/soc2intervall=.*$/soc2intervall=60/

Check failure on line 2394 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
s/soc2intervallladen=.*$/soc2intervallladen=10/

Check failure on line 2395 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
" $ConfigFile.tmp > $ConfigFile.tmp.out

Check failure on line 2396 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
cp $ConfigFile.tmp.out $ConfigFile.tmp

Check failure on line 2397 in runs/updateConfig.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
fi
# modify configured smarteq modules to none
sed -e '
s/socmodul=soc_smarteq/socmodul=none/
s/socmodul1=soc_smarteqlp2/socmodul1=none/
/soc2pint=/d
/soc_smarteq/d
' $ConfigFile.tmp > $ConfigFile.tmp.out
cp $ConfigFile.tmp.out $ConfigFile
rm $ConfigFile.tmp $ConfigFile.tmp.out

echo "Config file Update done."
}

0 comments on commit de2f394

Please sign in to comment.