18 lines
341 B
Bash
18 lines
341 B
Bash
|
#!/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 /tmp/flashmnt
|
||
|
echo Done!
|