@@ -7,7 +7,7 @@ timezones() {
77 TZ=$( cat /etc/timezone)
88
99 # 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
1111
1212}
1313
@@ -85,9 +85,11 @@ mainmenu_selection=$(whiptail --title "Main Menu" --menu --notags \
8585 " install" " Install Docker" \
8686 " build" " Build Stack" \
8787 " hassio" " Install Hass.io (Requires Docker)" \
88+ " native" " Native Installs" \
8889 " commands" " Docker commands" \
8990 " backup" " Backup options" \
9091 " misc" " Miscellaneous commands" \
92+ " update" " Update IOTstack" \
9193 3>&1 1>&2 2>&3 )
9294
9395case $mainmenu_selection in
@@ -131,6 +133,7 @@ case $mainmenu_selection in
131133 " pihole" " Pi-Hole" " OFF" \
132134 " plex" " Plex media server" " OFF" \
133135 " tasmoadmin" " TasmoAdmin" " OFF" \
136+ " rtl_433" " RTL_433 to mqtt" " OFF" \
134137 3>&1 1>&2 2>&3 )
135138
136139 mapfile -t containers <<< " $container_selection"
@@ -157,16 +160,19 @@ case $mainmenu_selection in
157160 # MAINMENU Docker commands -----------------------------------------------------------
158161" commands" )
159162
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+ )
170176
171177 case $docker_selection in
172178 " start" ) ./scripts/start.sh ;;
@@ -176,6 +182,16 @@ case $mainmenu_selection in
176182 " pull" ) ./scripts/update.sh ;;
177183 " prune_volumes" ) ./scripts/prune-volumes.sh ;;
178184 " 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+ ;;
179195 esac
180196 ;;
181197 # Backup menu ---------------------------------------------------------------------
@@ -266,6 +282,25 @@ case $mainmenu_selection in
266282 exit
267283 fi
268284 ;;
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+ ;;
269304* ) ;;
270305
271306esac
0 commit comments