#!/bin/bash if [ "$#" -ne 1 ]; then echo "Usage: fsmi.sh " exit 1 fi if [[ "$1" == "fsi" ]]; then state=$(curl https://www-test.fsmi.org/spaceapi/fsi.json 2>/dev/null | jq .state.open) elif [[ "$1" == "fsm" ]]; then state=$(curl https://www-test.fsmi.org/spaceapi/fsm.json 2>/dev/null | jq .state.open) fi class="fs-closed" if [[ "$state" == "true" ]]; then class="fs-open" elif [[ "$state" == "" ]]; then class="fs-unknown" fi cat <