@@ -7,7 +7,7 @@ timezones() {
7
7
TZ=$( cat /etc/timezone)
8
8
9
9
# test for TZ=
10
- [ $( grep " TZ=" $env_file ) ] && sed -i " /TZ=/c\TZ=$TZ " $env_file
10
+ [ $( grep -c " TZ=" $env_file ) -ne 0 ] && sed -i " /TZ=/c\TZ=$TZ " $env_file
11
11
12
12
}
13
13
@@ -85,9 +85,11 @@ mainmenu_selection=$(whiptail --title "Main Menu" --menu --notags \
85
85
" install" " Install Docker" \
86
86
" build" " Build Stack" \
87
87
" hassio" " Install Hass.io (Requires Docker)" \
88
+ " native" " Native Installs" \
88
89
" commands" " Docker commands" \
89
90
" backup" " Backup options" \
90
91
" misc" " Miscellaneous commands" \
92
+ " update" " Update IOTstack" \
91
93
3>&1 1>&2 2>&3 )
92
94
93
95
case $mainmenu_selection in
@@ -131,6 +133,7 @@ case $mainmenu_selection in
131
133
" pihole" " Pi-Hole" " OFF" \
132
134
" plex" " Plex media server" " OFF" \
133
135
" tasmoadmin" " TasmoAdmin" " OFF" \
136
+ " rtl_433" " RTL_433 to mqtt" " OFF" \
134
137
3>&1 1>&2 2>&3 )
135
138
136
139
mapfile -t containers <<< " $container_selection"
@@ -157,16 +160,19 @@ case $mainmenu_selection in
157
160
# MAINMENU Docker commands -----------------------------------------------------------
158
161
" commands" )
159
162
160
- docker_selection=$( whiptail --title " Docker commands" --menu --notags \
161
- " Shortcut to common docker commands" 20 78 12 -- \
162
- " start" " Start stack" \
163
- " restart" " Restart stack" \
164
- " stop" " Stop stack" \
165
- " stop_all" " Stop any running container regardless of stack" \
166
- " pull" " Update all containers" \
167
- " prune_volumes" " Delete all stopped containers and docker volumes" \
168
- " prune_images" " Delete all images not associated with container" \
169
- 3>&1 1>&2 2>&3 )
163
+ docker_selection=$(
164
+ whiptail --title " Docker commands" --menu --notags \
165
+ " Shortcut to common docker commands" 20 78 12 -- \
166
+ " aliases" " Add iotstack_up and iotstack_down aliases" \
167
+ " start" " Start stack" \
168
+ " restart" " Restart stack" \
169
+ " stop" " Stop stack" \
170
+ " stop_all" " Stop any running container regardless of stack" \
171
+ " pull" " Update all containers" \
172
+ " prune_volumes" " Delete all stopped containers and docker volumes" \
173
+ " prune_images" " Delete all images not associated with container" \
174
+ 3>&1 1>&2 2>&3
175
+ )
170
176
171
177
case $docker_selection in
172
178
" start" ) ./scripts/start.sh ;;
@@ -176,6 +182,16 @@ case $mainmenu_selection in
176
182
" pull" ) ./scripts/update.sh ;;
177
183
" prune_volumes" ) ./scripts/prune-volumes.sh ;;
178
184
" prune_images" ) ./scripts/prune-images.sh ;;
185
+ " aliases" )
186
+ touch ~ /.bash_aliases
187
+ if [ $( grep -c ' IOTstack' ~ /.bash_aliases) -eq 0 ]; then
188
+ echo " . ~/IOTstack/.bash_aliases" >> ~/.bash_aliases
189
+ echo " added aliases"
190
+ else
191
+ echo " aliases already added"
192
+ fi
193
+ source ~ /.bashrc
194
+ ;;
179
195
esac
180
196
;;
181
197
# Backup menu ---------------------------------------------------------------------
@@ -266,6 +282,25 @@ case $mainmenu_selection in
266
282
exit
267
283
fi
268
284
;;
285
+ " update" )
286
+ echo " Pulling latest project file from Github.com ---------------------------------------------"
287
+ git pull origin master
288
+ echo " git status ------------------------------------------------------------------------------"
289
+ git status
290
+ ;;
291
+ " native" )
292
+
293
+ native_selections=$( whiptail --title " Native installs" --menu --notags \
294
+ " Install local applications" 20 78 12 -- \
295
+ " rtl_433" " RTL_433" \
296
+ 3>&1 1>&2 2>&3 )
297
+
298
+ case $native_selections in
299
+ " rtl_433" )
300
+ bash ./.native/rtl_433.sh
301
+ ;;
302
+ esac
303
+ ;;
269
304
* ) ;;
270
305
271
306
esac
0 commit comments