summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-12-02 18:09:13 +0100
committerErich Eckner <git@eckner.net>2016-12-02 18:09:13 +0100
commit5beeaf7b734c74655d5663fa614a687b9d2522fd (patch)
treee02516db255947d35272ca604b07bb99eeceff7b
downloadmounted-5beeaf7b734c74655d5663fa614a687b9d2522fd.tar.xz
Initial commit
-rwxr-xr-xmounted31
1 files changed, 31 insertions, 0 deletions
diff --git a/mounted b/mounted
new file mode 100755
index 0000000..3899b79
--- /dev/null
+++ b/mounted
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -o pipefail
+
+mounts="$(mount | grep "\(^/dev/\)\|\(ncpfs\)\|\(fuse.sshfs\)" | grep -v '\s/mnt/key\s')"
+lines=$(echo "${mounts}" | wc -l)
+
+for (( i=1; i<=${lines}; i++))
+do
+ mount="$(echo "${mounts}" | head -n$i | tail -n1)"
+ dev="$(echo "${mount}" | awk '{print $1}')"
+ mp="$(echo "${mount}" | awk '{print $3}')"
+ case "${mp}" in
+ "/mnt/windows" ) mpa="win" ;;
+ "/mnt/141.35.60.68_home_simulation" ) mpa="smh" ;;
+ "/mnt/141.35.60.68_home_experiment" ) mpa="exh" ;;
+ "/mnt/141.35.60.68_home_expshhg" ) mpa="esh" ;;
+ "/mnt/141.35.60.68_home_erich" ) mpa="seh" ;;
+ "/mnt/141.35.50.159_home" ) mpa="nse" ;;
+ "/mnt/141.35.51.219_expshhg" ) mpa="jes" ;;
+ "/mnt/141.35.60.68" ) mpa="sim" ;;
+ "/mnt/192.168.0.12" ) mpa="hom" ;;
+ * ) mpa="${mp}" ;;
+ esac
+ if [ "${mp}" == "/" ] || df -a | grep -q "^${dev} "
+ then
+ echo " ${mpa} \$color\${fs_used ${mp}}/\${fs_size ${mp}} \${fs_bar 6 ${mp}}"
+ else
+ echo " ${dev} -> ${mp}"
+ fi
+done