#!/bin/bash -e # usage # cd /etc/; fstab2uml grep -v -e '^\s*#' -e '^\s*$' fstab | sed -r 's|(^[^ ]+) *([^ ]*) .*|database "\2" <<\1>>|g' grep -v -e '^\s*#' -e '^\s*$' fstab | grep x-systemd | tr -s ' ' | cut -d ' ' -f 1,2 | xargs -n 1 -I {} bash -c 'grep ^$(echo {}| cut -d " " -f 1) fstab | tr "," "\n" | tr " " "\n" | grep "x-systemd\." | sed -r "s|x-systemd\.(.*)=(.*)|[\2]: \1|" | xargs -n 1 -I [] echo "[$(echo {} | cut -d " " -f 2)] -up-> []"'