From 97b5279ba21f25baf94ca1df86da35197ebf0409 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Sat, 24 Apr 2010 23:54:14 -0700 Subject: [PATCH] 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. --- vfat-label.sh | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) create mode 100755 vfat-label.sh 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 -- 1.6.6.rc1.39.g9a42