-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup
executable file
·48 lines (35 loc) · 1.33 KB
/
setup
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
#!/bin/bash
# Fronius Smartmeter
# 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/FroniusSmartmeter/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="SirUli"
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 Fronius Smart Meter and forwards it to the Victron Dbus"
scriptAction='INSTALL'
fi
#### install code goes here
if [ "$scriptAction" == 'INSTALL' ] ; then
logMessage "++ Installing Victron Dbus Fronius Smartmeter service"
installService "$packageName"
fi
#### uninstalling - check scriptAction again
# if an install step failed package needs to be removed
if [ "$scriptAction" == 'UNINSTALL' ] ; then
logMessage "++ Uninstalling Victron Dbus Fronius Smartmeter service"
removeService "$packageName"
fi
endScript