2020-12-12 23:31:42 +01:00
|
|
|
#!/usr/bin/env bash
|
2021-06-08 00:00:33 +02:00
|
|
|
set -ex
|
2020-12-12 23:31:42 +01:00
|
|
|
|
|
|
|
IMAGE_PATH_DIR=$1
|
|
|
|
mkdir test/fat32/mnt
|
2021-06-08 00:00:33 +02:00
|
|
|
whoami
|
|
|
|
|
|
|
|
if [ "$(whoami)" = "root" ]; then
|
|
|
|
echo "Am root"
|
|
|
|
mount -o utf8=true $IMAGE_PATH_DIR test/fat32/mnt/
|
|
|
|
cp -r test/fat32/test_files/. test/fat32/mnt/
|
|
|
|
umount test/fat32/mnt/
|
|
|
|
else
|
|
|
|
echo "Not root"
|
|
|
|
sudo mount -o utf8=true $IMAGE_PATH_DIR test/fat32/mnt/
|
|
|
|
sudo cp -r test/fat32/test_files/. test/fat32/mnt/
|
|
|
|
sudo umount test/fat32/mnt/
|
|
|
|
fi
|
|
|
|
|
2020-12-12 23:31:42 +01:00
|
|
|
rm -rf test/fat32/mnt
|