-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsetup
executable file
·97 lines (78 loc) · 4.04 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# this script sets up the SetupHelper service and other resources associated with package updates
# This service provides automatic and manual updates for Venus modificaiton packages
#
#### 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
# remove settings no longer used
cleanup ()
{
# cleanup from older versions
restoreActiveFile "$qmlDir/PageSettingsPackageControl.qml"
dbus-send --system --print-reply=literal --dest=com.victronenergy.settings /Settings/GuiMods/GitHubAutoUpdate\
com.victronenergy.BusItem.GetValue &> /dev/null
if (( $? == 0 )); then
removeDbusSettings /Settings/GuiMods/PackageVersions/GeneratorConnector /Settings/GuiMods/PackageVersions/GuiMods\
/Settings/GuiMods/PackageVersions/GuiMods /Settings/GuiMods/PackageVersions/RpiDisplaySetup\
/Settings/GuiMods/PackageVersions/RpiGpioSetup /Settings/GuiMods/PackageVersions/RpiTemp\
/Settings/GuiMods/PackageVersions/SetupHelper /Settings/GuiMods/PackageVersions/TankRepeater,\
/Settings/GuiMods/PackageVersions/VeCanSetup /Settings/GuiMods/PackageVersions/ShutdownMonitor\
/Settings/GuiMods/CheckingPackage /Settings/GuiMods/GitHubAutoUpdate > /dev/null
removeDbusSettings /Settings/PackageVersion/Count /Settings/PackageVersion/New/GitHubUser \
/Settings/PackageVersion/New/GitHubBranch /Settings/PackageVersion/New/InstalledVersion \
/Settings/PackageVersion/New/PackageName /Settings/PackageVersion/New/PackageVersion \
/Settings/PackageVersion/GitHubAutoUpdate /Settings/PackageVersion/EditAction \
/Settings/PackageVersion/CheckingPackage > /dev/null
fi
}
#### running manually and OK to proceed - prompt for input
if [ $scriptAction == 'NONE' ] ; then
# create dbus Settings if they haven't been set previously
# if one setting exists, assume they are all there
# NOTE: if new settings are added in the future, change test for that one
# to avoid creating that new parameter !!!!
# display initial message
echo
echo "This package provides support functions and utilities for Venus modification packages"
echo "Packages are automatically reinstalled following a Venus OS update"
echo "All actions are controlled via /Settings/PackageMonitor in the GUI"
echo " Packages may be automatically updated from GitHub or a USB stick"
echo " Previously uninstalled packages can also be downloaded an installed"
echo
standardActionPrompt
fi
if [ $scriptAction == 'INSTALL' ] ; then
updateActiveFile "$qmlDir/PageSettings.qml"
updateActiveFile "$qmlDir/PageSettingsPackageManager.qml"
updateActiveFile "$qmlDir/PageSettingsPackageVersions.qml"
updateActiveFile "$qmlDir/PageSettingsPackageEdit.qml"
updateActiveFile "$qmlDir/MbDisplayPackageVersion.qml"
updateActiveFile "$qmlDir/PageSettingsAddPackageList.qml"
updateActiveFile "$qmlDir/PageSettingsPackageAdd.qml"
updateActiveFile "$qmlDir/MbDisplayDefaultPackage.qml"
updateActiveFile "$qmlDir/PageSettingsPmBackup.qml"
updateActiveFile "$qmlDir/PageSettingsPmInitialize.qml"
installService PackageManager
cleanup
fi
if [ $scriptAction == 'UNINSTALL' ] ; then
restoreActiveFile "$qmlDir/PageSettings.qml"
restoreActiveFile "$qmlDir/PageSettingsPackageManager.qml"
restoreActiveFile "$qmlDir/PageSettingsPackageVersions.qml"
restoreActiveFile "$qmlDir/PageSettingsPackageEdit.qml"
restoreActiveFile "$qmlDir/MbDisplayPackageVersion.qml"
restoreActiveFile "$qmlDir/PageSettingsAddPackageList.qml"
restoreActiveFile "$qmlDir/PageSettingsPackageAdd.qml"
restoreActiveFile "$qmlDir/MbDisplayDefaultPackage.qml"
restoreActiveFile "$qmlDir/PageSettingsPmBackup.qml"
restoreActiveFile "$qmlDir/PageSettingsPmInitialize.qml"
removeService PackageManager
cleanup
fi
if $filesUpdated ; then
restartGui=true
fi
# thats all folks - SCRIPT EXITS INSIDE THE FUNCTION
endScript