Skip to content

Commit

Permalink
fixed serial-starter.d
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Apr 15, 2023
1 parent 256c9ae commit 9393245
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
--exclude restartservice.sh \
--exclude revov.py \
--exclude test_max17853.py \
conf/serial-starter.d \
etc/dbus-serialbattery/
- name: Release
Expand Down
3 changes: 0 additions & 3 deletions conf/serial-starter.d

This file was deleted.

2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/disabledriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DRIVERNAME=dbus-serialbattery
sh /opt/victronenergy/swupdate-scripts/remount-rw.sh

# remove files
rm -f /data/conf/serial-starter.d
rm -f /data/conf/serial-starter.d/$DRIVERNAME.conf

# kill if running
pkill -f "python .*/$DRIVERNAME.py"
Expand Down
23 changes: 18 additions & 5 deletions etc/dbus-serialbattery/reinstalllocal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,24 @@ cp -rf /data/etc/$DRIVERNAME/service /opt/victronenergy/service-templates/$DRIVE
sh /data/etc/$DRIVERNAME/installqml.sh

# check if serial-starter.d was deleted
serialstarter=/data/conf/serial-starter.d
if [ ! -f $serialstarter ]; then
echo "service sbattery dbus-serialbattery" >> $serialstarter
echo "alias default gps:vedirect:sbattery" >> $serialstarter
echo "alias rs485 cgwacs:fzsonick:imt:modbus:sbattery" >> $serialstarter
serialstarter_path="/data/conf/serial-starter.d"
serialstarter_file="$serialstarter_path/dbus-serialbattery.conf"

# check if folder is a file (older versions of this driver)
if [ -f $serialstarter_path ]; then
rm -f $serialstarter_path
fi

# check if folder exists
if [ ! -d $serialstarter_path ]; then
mkdir $serialstarter_path
fi

# check if file exists
if [ ! -f $serialstarter_file ]; then
echo "service sbattery dbus-serialbattery" >> $serialstarter_file
echo "alias default gps:vedirect:sbattery" >> $serialstarter_file
echo "alias rs485 cgwacs:fzsonick:imt:modbus:sbattery" >> $serialstarter_file
fi

# restart if running
Expand Down
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DRIVERNAME=dbus-serialbattery
sh /opt/victronenergy/swupdate-scripts/remount-rw.sh

# remove files
rm -f /data/conf/serial-starter.d
rm -f /data/conf/serial-starter.d/$DRIVERNAME.conf
rm -rf /opt/victronenergy/service/$DRIVERNAME
rm -rf /opt/victronenergy/service-templates/$DRIVERNAME
rm -rf /opt/victronenergy/$DRIVERNAME
Expand Down

0 comments on commit 9393245

Please sign in to comment.