2021-03-06 23:40:15 +00:00
|
|
|
#!/bin/sh
|
2021-03-28 04:38:12 +00:00
|
|
|
H=/tmp/folheader
|
|
|
|
echo '#!/bin/sh' > $H
|
2021-08-15 17:51:07 +00:00
|
|
|
echo D=\"$1\" >> $H
|
2021-03-28 04:38:12 +00:00
|
|
|
cat >> $H <<'EOF'
|
2021-08-15 17:51:07 +00:00
|
|
|
if [ ! -d "$D" ]; then
|
|
|
|
mkdir "$D"
|
|
|
|
dwarfs -o offset=auto "$0" "$D"
|
2021-03-06 23:40:15 +00:00
|
|
|
else
|
2021-08-15 17:51:07 +00:00
|
|
|
fusermount -u "$D"
|
|
|
|
rmdir "$D"
|
2021-03-06 23:40:15 +00:00
|
|
|
fi
|
2021-03-28 04:38:12 +00:00
|
|
|
exit
|
2021-03-06 23:40:15 +00:00
|
|
|
EOF
|
|
|
|
|
2021-08-15 17:51:07 +00:00
|
|
|
shift
|
|
|
|
mkdwarfs -i . -o "$PWD.sh" --header $H $@
|
2021-03-06 23:40:15 +00:00
|
|
|
chmod +x "$PWD.sh"
|
2021-03-28 04:38:12 +00:00
|
|
|
rm $H
|