Skip to content

Instantly share code, notes, and snippets.

@matoken
Last active December 7, 2015 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matoken/e051cefb78594520038d to your computer and use it in GitHub Desktop.
Save matoken/e051cefb78594520038d to your computer and use it in GitHub Desktop.
#!/bin/bash
DD=/bin/dd
for i in $@; do
if [[ "$i" =~ ^of= ]]; then
OF=${i/of=/}
fi
done
for i in $( mount | awk '{print $1}' ); do
if [[ "$i" =~ ^$OF ]]; then
echo $OF seems to specify the file system in the mount.
echo Force Quit.
exit -1
fi
done
`$DD $@`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment