Code: Select all
if [ -f "$1.sfs" ];then
DO=$(yad --window-icon="application-x-squashfs-image" --title="Overwrite" --text="<b>$(basename $1).sfs</b> already exists.\n Would you like to overwrite or rename it?\n" \
--text-align="center" --borders="10" --buttons-layout="center" --button="gtk-yes:1" --button="gtk-no:0" --center --timeout 2)
case $DO in
0|252) exit ;;
70|1) rm -f "$1.sfs" "$1.sfs-md5.txt" ;;
esac
fi
Code: Select all
--button="GZIP:0" --button="XZ:1" --button="XZ-HC:2" --center --timeout 2
[[ $? == "" ]] && $?="1"
case $? in
0) COMP="-comp gzip" ;;
1) COMP="-comp xz" ;;
2) COMP="-comp xz -b 1024k -Xbcj x86" ;;
*) exit ;;
esac
Code: Select all
if [ $? -ne 0 ]; then
rm -f "$1.sfs"
killall mksquashfs
kill $PID
rm -f typescript
exit
fi
EDIT: Maybe we can assign the pid for each mksquashfs process.
Code: Select all
echo "$((RANDOM))" >/tmp/$1
Code: Select all
cat /tmp/$1 > /proc/sys/kernel/ns_last_pid; mksquashfs
Code: Select all
kill $(cat /tmp/$1)