2013-02-17 02:16:55 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
2013-10-09 10:40:52 +02:00
|
|
|
set -x
|
2013-02-17 02:16:55 +01:00
|
|
|
|
|
|
|
if [ $# -eq 2 ]; then
|
2013-10-09 10:40:52 +02:00
|
|
|
mount -o noexec,nosuid,nodev "${1}" "${2}"
|
|
|
|
# renaming autorun.inf on the source key. As it it case insensitive, we have to do the following...
|
|
|
|
ls "${2}" | grep -i autorun.inf | xargs -I {} mv "${2}"/{} "${2}"/DANGEROUS_{}_DANGEROUS || true
|
2013-10-09 11:07:07 +02:00
|
|
|
mount -o remount,ro "${1}" "${2}"
|
2013-02-17 02:16:55 +01:00
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo 'Invalid number of arguments.'
|
|
|
|
exit 1
|
|
|
|
fi
|