I need $SQ_EXT, $MENU, $pkgN evaluated, all other variables as literals.
Code: Select all
echo "#!/bin/sh
MntPt=/SqApp/mnt/$pkgN
SqF=\`basename $MntPt\`.$SQ_EXT
if [ \"$1\" = '-m' ];then
echo $MENU
elif [ \"$1\" = '-x' ];then
umount $MntPt
[ $? -gt 0 ]&& echo -e \" \n### ERROR: Failed SqApp unmount: $SqF\n\"
else
[ ! -f $pkgN.$SQ_EXT ]&&
echo -e \" \n### ERROR: No SqApp. file: $SqF\n\" && exit
[ \"\`df |grep $MntPt\`\" ]||
mount -o loop /SqApp/bin/$pkgN.$SQ_EXT $MntPt
[ $? -gt 0 ]&&
echo -e \" \n### ERROR: Failed mounting SqApp. file: $SqF\n\" && exit
cd $MntPt
/$pkgN.run &
fi
' > $mntPT/SqApp/bin/$pkgN