From: Colin Patrick McCabe Date: Sun, 25 Apr 2010 06:54:14 +0000 (-0700) Subject: Add vfat-label script X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97b5279ba21f25baf94ca1df86da35197ebf0409;p=cmccabe-bin Add vfat-label script This script provides an interface similar to e2label to set the labels on vfat-formatted disks. It's basically a pretty thin wrapper around mtools, which mitigates mtools' awkward syntax. --- diff --git a/vfat-label.sh b/vfat-label.sh new file mode 100755 index 0000000..5168491 --- /dev/null +++ b/vfat-label.sh @@ -0,0 +1,35 @@ +#!/bin/bash -x + +usage() { + cat < + +To set the label: +vfat-label.sh +EOF + exit 1 +} + +die() { + echo "$@" + exit 1 +} + +which mlabel 1>/dev/null 2>/dev/null || \ + die "You need to install mtools for this to work." + +if [ "x${1}" == "x-h" ]; then + usage +fi + +if [ $# -eq 1 ]; then + mlabel -i "${1}" -s :: +elif [ $# -eq 2 ]; then + mlabel -i "${1}" ::${2} +else + usage +fi