-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
56 lines (40 loc) · 1.46 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
49
50
51
52
53
54
55
56
#!/bin/bash
# setup Rasperry Pi Temprature mechanism
# This modification adds the raspberry pi temperature to Victron Venus OS
# Venus files that need to be updated to activeate this package
qmlDir=/opt/victronenergy/gui/qml
packageLogFile="/var/log/RpiTemperature/current"
#### following lines incorporate SetupHelper utilities into this script
# Refer to the SetupHelper ReadMe file for details.
source "/data/SetupHelper/CommonResources"
#### end of lines to include SetupHelper
#### running manually and OK to proceed - prompt for input
if [ $scriptAction == 'NONE' ] ; then
echo
echo "The RpiTemperature adds the Rasperry Pi CPU Temperture"
echo
standardActionPrompt
fi
#### here to do the actual work
if [ $scriptAction == 'INSTALL' ] ; then
logMessage "++ Installing RpiTemperature"
# updateActiveFile "$qmlDir/PageSettingsGeneral.qml"
# updateActiveFile "$qmlDir/PageSettingsShutdown.qml"
installService $packageName
if $filesUpdated ; then
restartGui=true
fi
fi
# #### uninstalling - check scriptAction again
# if an install step failed package needs to be removed
if [ $scriptAction == 'UNINSTALL' ] ; then
logMessage "++ Uninstalling RpiTemperature"
# restoreActiveFile "$qmlDir/PageSettingsGeneral.qml"
# restoreActiveFile "$qmlDir/PageSettingsShutdown.qml"
removeService $packageName
fi
if $filesUpdated ; then
restartGui=true
fi
# thats all folks - SCRIPT EXITS INSIDE THE FUNCTION
endScript