rootfs/usr/local/bin/autorun: adding autorun checks on new fat32 formatted USER partition

This commit is contained in:
Sam Ebstein 2024-09-19 12:52:39 -07:00
parent 8378ddad95
commit d0a3b06f37
Signed by: sam.ebstein
GPG Key ID: 6418F27A5E20ADD7
1 changed files with 13 additions and 1 deletions

View File

@ -4,7 +4,19 @@ source /etc/profile
folder=${1?} folder=${1?}
if [ -f "${folder}/autorun.sh.asc" ]; then echo "Checking autorun in folder: ${folder}" >/dev/console
if [ "$folder" == "/media/USER" ] && [ -f "${folder}/autorun.sh" ]; then
if touch "${folder}/.write_test" 2>/dev/null; then
echo "!! Autorun: Read-only verification failed for /media/USER" >/dev/console
exit 1;
else
echo "" >/dev/console
echo "++ Autorun: Found /media/USER/autorun.sh" >/dev/console;
echo "** Autorun: Executing /media/USER/autorun.sh" >/dev/console
/bin/bash "/media/USER/autorun.sh" >/dev/console
fi
elif [ -f "${folder}/autorun.sh.asc" ]; then
echo "" >/dev/console echo "" >/dev/console
echo "++ Autorun: Found ${folder}/autorun.sh" >/dev/console; echo "++ Autorun: Found ${folder}/autorun.sh" >/dev/console;
gpg --verify "${folder}/autorun.sh.asc" >/dev/null 2>&1 || { gpg --verify "${folder}/autorun.sh.asc" >/dev/null 2>&1 || {