Latest version
This commit is contained in:
parent
e3a2efdb43
commit
eb0aab1613
17 changed files with 815 additions and 328 deletions
27
destroy-squash-image
Executable file
27
destroy-squash-image
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
DIR="$@"
|
||||
DIR=$(readlink -f "$DIR")
|
||||
DIR_SHORT=$(basename $DIR)
|
||||
|
||||
if [[ -f "$DIR/.needs_mount" ]];
|
||||
then
|
||||
echo "Not a SquashFS image, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Destroying the existing SquashFS image."
|
||||
echo "Copying data from the original directory."
|
||||
|
||||
echo "Using rsync... in 2 seconds."
|
||||
sleep 2
|
||||
rsync -avz --progress "$DIR" "/tmp/$DIR_SHORT.tmp"
|
||||
|
||||
umount-squash-image "$DIR"
|
||||
|
||||
rm -rf "$DIR"
|
||||
mv "/tmp/$DIR_SHORT.tmp" "$DIR"
|
||||
|
||||
rm -rf "$DIR/../.squashfs/$DIR_SHORT.img"
|
||||
rm -rf "$DIR/../.squashfs/$DIR_SHORT"
|
||||
|
||||
echo "Your SquashFS image was deleted."
|
||||
Loading…
Add table
Add a link
Reference in a new issue