#!/bin/bash
#
# Copyright (c) 2012-2022 by cisco Systems, Inc.
# All rights reserved.
#
# This is the show file system command. This can be expanded
# as new requirements come up.
# 
# Platform: Non-Lindt Only

FORMAT="%s %s %s %s %s\n"
df -hlP | \
  sed `for i in /*: ; do [ -h $i ] && echo \ -e s,$(readlink $i),${i#/},; done` | \
  grep -vE '(overlay|shm|none|Filesys|mnt|run|boot|rootfs|common|tmpfs|devfs|panini.*lv0|cmdline|^run|unionfs)' | \
  sed -e 's,/misc/config,config:,g' \
      -e 's,/misc/disk1,harddisk:,g' \
      -e 's,/var/xr/disk1,harddisk:,g' \
      -e 's,/misc/scratch,disk0:,g' \
      -e 's,/var/xr/scratch,disk0:,g' \
      -e 's,/misc/app_host,apphost:,g' \
      -e 's,/var/log,log:,g' \
      -e 's,/$,rootfs:,g' | \
  awk '{printf "'"$FORMAT"'",$6,$2,$3,$5,$4}' |\
  sed -e "s/harddiska:b/harddiskb: /"  # cleanup
