-do_config() {
- local urlpath
- urlpath=$base_config
- case $1 in
- (get|list)
- if [ "x$2" != "x" ]; then
- urlpath="$urlpath/$2"
- fi
- if rest GET $urlpath; then
- json_reformat < $resultfile
- else
- status=1
- fi
- ;;
- (add|update)
- if rest POST $urlpath "@$2" ; then
- cat $resultfile
- else
- status=1
- fi
- ;;
- (del|delete|remove|rem)
- if rest DELETE $urlpath "@$2" ; then
- cat $resultfile
- else
- status=1
- fi
- ;;
- (*)
- echo "$myname: unrecognized config subcommand $1"
- status=1
- esac
-}
-