Skip to content

Commit 1661e3e

Browse files
openhabianopenhabian
authored andcommitted
do unattended setup if grottSetupEnabled is true
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
1 parent 49e7252 commit 1661e3e

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

build-image/openhabian.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,6 @@ storagecapacity=1024
120120
# tstags=tag:client
121121

122122
# vim: filetype=sh
123+
124+
# Grott settings (only enable this if Growatt binding will be used)
125+
# grottSetupEnabled=false

functions/packages.bash

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,12 @@ install_grott() {
939939
fi
940940
local installType="$1"
941941

942+
# In non- interactive mode, skip setup unless openhabian.config grottSetupEnabled == true
943+
if [[ -z "$INTERACTIVE" ]] && ( [[ -z "$grottSetupEnabled" ]] || [[ "$grottSetupEnabled" != "true" ]] ); then
944+
echo "$(timestamp) [openHABian] Setup Grott Proxy... SKIPPED (setup not enabled)"
945+
return 0
946+
fi
947+
942948
# Constants for local system
943949
local _user="${username:-openhabian}"
944950
local grottFolder="/home/${_user}/grott"
@@ -1027,6 +1033,8 @@ install_grott() {
10271033

10281034
if [[ -n "$INTERACTIVE" ]]; then
10291035
whiptail --title "Grott Proxy Installed" --msgbox "We installed Grott Proxy on your system." 7 80
1036+
else
1037+
echo "$(timestamp) [openHABian] Installed Grott Proxy."
10301038
fi
10311039
fi
10321040

@@ -1046,6 +1054,8 @@ install_grott() {
10461054

10471055
if [[ -n "$INTERACTIVE" ]]; then
10481056
whiptail --title "Grott Proxy Removed" --msgbox "We removed Grott Proxy from your system." 7 80
1057+
else
1058+
echo "$(timestamp) [openHABian] Removed Grott Proxy."
10491059
fi
10501060
fi
10511061

openhabian-setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ if [[ -n "$UNATTENDED" ]]; then
123123
nut_setup
124124
permissions_corrections
125125
setup_mirror_SD "install"
126+
install_grott "install"
126127
install_cleanup
127128
else
128129
apt_update

0 commit comments

Comments
 (0)