-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup
More file actions
executable file
·53 lines (38 loc) · 1.6 KB
/
Copy pathsetup
File metadata and controls
executable file
·53 lines (38 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Bluetooth Outback SPC Service
# Setup script (install/uninstall)
#
# this script will accept the following commands on the command line:
# setup install
# setup uninstall
# setup reinstall (used to reinstall after Venus OS update)
packageLogFile="/var/log/OutbackSPC/current"
#### following line incorporates SetupHelper utilities into this script
# Refer to the SetupHelper ReadMe file for details.
source "/data/SetupHelper/CommonResources"
# GitHub account info - fill in as appropriate
# to include this package in SetupHelper automatic updates
packageGitHubUser="DonDavici"
packageGitHubBranch="main"
#### end of lines to include SetupHelper
#### running manually and OK to proceed - prompt for input
if [ "$scriptAction" == 'NONE' ] ; then
# display initial message
echo "This package reads an via bluetooth form an Outback SPC and forwards it to the Victron Dbus"
# install needed bluetooth packages
#/opt/victronenergy/swupdate-scripts/resize2fs.sh; opkg update; opkg install python3-pip; opkg install packagegroup-core-buildessential; opkg install libglib-2.0-dev; pip3 install bluepy
scriptAction='INSTALL'
fi
#### install code goes here
if [ "$scriptAction" == 'INSTALL' ] ; then
logMessage "++ Installing Victron Dbus Bluetooth Outback SPC service"
installService "$packageName"
rebootNeeded=true
fi
#### uninstalling - check scriptAction again
# if an install step failed package needs to be removed
if [ "$scriptAction" == 'UNINSTALL' ] ; then
logMessage "++ Uninstalling Victron Dbus Bluetooth Outback SPC service"
removeService "$packageName"
fi
endScript