#!/bin/bash DO_JSON=0 MY_PATH=$(dirname $0) ##### MAIN ##### source ${MY_PATH}/general_funcs.bash arg_has_json "$@" if [ $? -eq 0 ]; then DO_JSON=1 fi declare -A hashmap hashmap[TEGRA_A]="192.168.0.1" hashmap[TEGRA_B]="192.168.2.1" hashmap[DCC_BMC]="192.168.1.1" if [ ${DO_JSON} -eq 1 ]; then map_to_json "hashmap" else map_to_human_readable "hashmap" fi exit 0