18 lines
344 B
Fish
Executable file
18 lines
344 B
Fish
Executable file
#!/usr/bin/env fish
|
|
|
|
test (whoami) != root && begin
|
|
echo must be root
|
|
exit 1
|
|
end
|
|
|
|
mkdir -p /tmp/flashmnt
|
|
echo Mounting $argv[1] to /tmp/flashmnt...
|
|
mount $argv[1] /tmp/flashmnt # arg 1
|
|
echo Copying $argv[2] to /tmp/flashmnt...
|
|
cp $argv[2] /tmp/flashmnt
|
|
echo Syncing...
|
|
sync
|
|
echo Unmounting /tmp/flashmnt...
|
|
umount -R /tmp/flashmnt
|
|
echo Done!
|