summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Lacerda <alacerda@alpinelinux.org>2015-04-30 14:39:08 +0000
committerAlan Lacerda <alacerda@alpinelinux.org>2015-04-30 14:39:08 +0000
commit0e1450b8d0f254fa75a0f1ec8b2d93f374576f84 (patch)
treeac55cb6e20b4b63aab739219ac774fc23ef81752
parentb390c0077a9c7a5423ca47acbcad82a1a9d350e2 (diff)
downloadsetup-box-0e1450b8d0f254fa75a0f1ec8b2d93f374576f84.tar.bz2
setup-box-0e1450b8d0f254fa75a0f1ec8b2d93f374576f84.tar.xz
setup-box: indentation and some comments
-rwxr-xr-xsetup-box18
1 files changed, 15 insertions, 3 deletions
diff --git a/setup-box b/setup-box
index 85835c5..2c9a868 100755
--- a/setup-box
+++ b/setup-box
@@ -116,7 +116,14 @@ search_meta_group() {
| sed 's/\"//g' \
| sed 's/,//g')
- final_pack="$final_pack "$packages
+ services=$(cat $i \
+ | jq '.$1[][]' \
+ | jq '.[] \
+ | select(.services)' \
+ | sed 's/\"//g')
+
+ final_pack="$final_pack "$packages
+ final_serv="$final_serv "$services
fi
done
}
@@ -196,12 +203,16 @@ main () {
# first of all lets redirect any error to the limbo
exec 2&> /dev/null
+ # Harvesting for all valid JSON files
+ # Getting ready to be used...
search_files
+ # If there is no arguments... let's show how to use this application
if [ $# -lt 1 ]; then
usage
fi
+ # If there is any argument... let's work
while getopts "d:e:g:hl" opt ; do
case $opt in
d) search_desktop "$OPTARG";;
@@ -217,10 +228,11 @@ main () {
# installing dependencies
# insdep
+ # Packages to be installed (includes services)
optimize_pack "$final_pack"
echo $final_pack
- echo ""
- echo "Agora verificando quais servicos precisam ser adicionados a inicializacao..."
+
+ # Services to be added to startup (just services)
optimize_serv "$final_serv"
add_services $final_serv