Circlean/fs/home/kitten/kitten_mount_src

16 lines
418 B
Plaintext
Raw Normal View History

#!/bin/bash
set -e
#set -x
if [ $# -eq 2 ]; then
mount -o noexec,nosuid,nodev,utf8=1 "${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
mount -o remount,ro "${1}" "${2}"
exit 0
else
echo 'Invalid number of arguments.'
exit 1
fi