Script to merge existing sce extensions in one's sce directory. Just launch the script, choose as many sce's from the menu that exist in the directory to be combined into one, name the final one, and it will be made to the name of your choosing in your sce dir. Press "q" when finished choosing sce's to combine into one. Edit OUTDIR at the beginning of script to choose where the files from the existing sce's will be copied to, leave alone to use /tmp if RAM is sufficient, change to hard storage if not.
#!/bin/sh
OUTDIR=/tmp/.newdir.1234
[ -d "$OUTDIR" ] || mkdir -p "$OUTDIR"
> /tmp/.scemergelist
> /tmp/.scemerge
cd /etc/sysconfig/tcedir/sce
ls *.sce | sed 's:.sce::' | sort > /tmp/.scemergelist
while true; do
cat /tmp/.scemergelist | select "Choose the sce you want to merge, it's files won't be overwritten by those chosen after it. Choose "q" for quit when you have completed your selection." "-"
read ANS < /tmp/select.ans
if [ "$ANS" == "q" ]; then
break
fi
grep "^$ANS$" /tmp/.scemerge || echo "$ANS" >> /tmp/.scemerge
sed -i "/^$ANS$/d" /tmp/.scemergelist
done
read -p "Enter name of final sce, example "desktop" for a desktop.sce of merged packages. " FINAL
echo " "
for I in `cat /tmp/.scemerge`; do
if [ -d /tmp/tcloop/"$I" ]; then
DIR1=/tmp/tcloop/"$I"
yes n | cp -ai "$DIR1"/* "$OUTDIR"/ 2>/dev/null
else
DIR1=/tmp/"$I".tmp
[ -d "$DIR1" ] || mkdir -p "$DIR1"
sudo mount /etc/sysconfig/tcedir/sce/"$I".sce "$DIR1" > /dev/null 2>&1
yes n | cp -ai "$DIR1"/* "$OUTDIR"/ > /dev/null 2>&1
sudo umount "$DIR1"
rmdir "$DIR1"
fi
done
sudo mksquashfs "$OUTDIR" /etc/sysconfig/tcedir/sce/"$FINAL".sce
echo ""$FINAL".sce is now in your sce directory."
sudo rm -r "$OUTDIR"