mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
/usr/bin/iiab-apps-to-be-installed: Quick scan to see what's not yet installed
This commit is contained in:
parent
933f2af620
commit
9dc838fdeb
3 changed files with 39 additions and 1 deletions
32
scripts/iiab-apps-to-be-installed
Executable file
32
scripts/iiab-apps-to-be-installed
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Lists IIAB Apps set to install BUT not yet installed (according to /etc/iiab/iiab_state.yml)
|
||||
|
||||
iiab_var_value() {
|
||||
v1=$(grep "^$1:\s" /opt/iiab/iiab/vars/default_vars.yml | tail -1 | sed "s/^$1:\s\+//; s/#.*//; s/\s*$//; s/^\(['\"]\)\(.*\)\1$/\2/")
|
||||
v2=$(grep "^$1:\s" /etc/iiab/local_vars.yml | tail -1 | sed "s/^$1:\s\+//; s/#.*//; s/\s*$//; s/^\(['\"]\)\(.*\)\1$/\2/")
|
||||
[[ $v2 != "" ]] && echo $v2 || echo $v1 # [ "$v2" ] ALSO WORKS
|
||||
}
|
||||
|
||||
# 2022-06-18: 40 apps (list not quite complete)
|
||||
#grep -l _installed: /opt/iiab/iiab/roles/*/tasks/install.yml | cut -d/ -f6 > /tmp/iiab-apps-list
|
||||
|
||||
# 2022-06-18: 46 apps (list incorrect) -- adds these 6: iiab_admin, minetest, network (HAS NO _installed VAR), pylibs, www_base, www_options
|
||||
#grep -l _installed: /opt/iiab/iiab/roles/*/tasks/* | cut -d/ -f6 | sort | uniq > /tmp/iiab-apps-list
|
||||
|
||||
# 2022-06-18: 50 apps (list long but ok!) -- adds these 10: dansguardian, dhcpd, iiab_admin, minetest, named, pylibs, squid, wondershaper, www_base, www_options
|
||||
grep -hro '[A-Za-z_][A-Za-z_]*_installed: True' --exclude-dir=0-DEPRECATED-ROLES /opt/iiab/iiab/roles | sed 's/_installed: True$//' | sort | uniq > /tmp/iiab-apps-list
|
||||
|
||||
while read app; do
|
||||
if [ $app == "calibre-web" ]; then
|
||||
app=calibreweb
|
||||
elif [ $app == "osm-vector-maps" ]; then
|
||||
app=osm_vector_maps
|
||||
fi
|
||||
|
||||
# echo ${app}_install: $(iiab_var_value ${app}_install)
|
||||
|
||||
if [[ $(iiab_var_value ${app}_install) =~ ^[Tt]rue$ ]] && ! grep -q "${app}_installed: True" /etc/iiab/iiab_state.yml; then
|
||||
echo $app
|
||||
fi
|
||||
done < /tmp/iiab-apps-list
|
Loading…
Add table
Add a link
Reference in a new issue