Circlean/fs/home/kitten/kitten_mount_src

16 lines
411 B
Bash
Executable File

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