Skip to content

Commit

Permalink
ofgwrite_caller: cleanup fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
BPanther authored and vanhofen committed Jan 21, 2023
1 parent 4413057 commit cf20d42
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions ofgwrite_caller
Expand Up @@ -12,17 +12,17 @@ workdir=$(mktemp -d "$1"/update-XXXXXX)
cd $workdir

echo "Unpacking $2 to $workdir"
if [ "${2##*.}" = "tgz" ]; then
tar zxvf $2
elif [ "${2##*.}" = "zip" ]; then
unzip -oj $2 -x *disk.img*
if [ "${2##*.}" == "tgz" ]; then
tar zxvf "$2"
elif [ "${2##*.}" == "zip" ]; then
unzip -oj "$2" -x *disk.img*
else
exit 1
fi

if [ "${2:0:5}" == "/tmp/" ]; then
echo "Delete: $2"
rm -f $2
rm -f "$2"
fi

echo "Shifting options"
Expand Down Expand Up @@ -63,13 +63,17 @@ fi
echo "Calling ofgwrite $@ $workdir"
ofgwrite $@ $workdir

while pidof ofgwrite; do
sleep 5
done

cd /tmp

#echo "Unmounting /newroot"
#umount /newroot
echo "Unmounting /newroot"
umount /newroot

#echo "Removing /newroot"
#rm -rf /newroot
echo "Removing /newroot"
rm -rf /newroot

#echo "Removing tempdir"
#rm -rf $workdir
echo "Removing tempdir"
rm -rf $workdir

0 comments on commit cf20d42

Please sign in to comment.