mirror of
https://github.com/mgree/ffs.git
synced 2024-08-16 23:00:48 +03:00
27 lines
492 B
Bash
27 lines
492 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
fail() {
|
||
|
echo FAILED: $1
|
||
|
if [ "$MNT" ]
|
||
|
then
|
||
|
rm -r "$MNT"
|
||
|
fi
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
MNT=$(mktemp -d)
|
||
|
|
||
|
unpack --into "$MNT" ../json/obj_rename.json || fail unpack
|
||
|
|
||
|
case $(ls "$MNT") in
|
||
|
(_.*_..*dot*dotdot) ;;
|
||
|
(*) fail ls;;
|
||
|
esac
|
||
|
[ "$(cat $MNT/_.)" = "first" ] || fail .
|
||
|
[ "$(cat $MNT/_..)" = "second" ] || fail ..
|
||
|
[ "$(cat $MNT/dot)" = "third" ] || fail dot
|
||
|
[ "$(cat $MNT/dotdot)" = "fourth" ] || fail dotdot
|
||
|
|
||
|
pack "$MNT" || fail pack
|
||
|
rm -r "$MNT" || fail mount
|