Hello,
I've hacked up an alternative to the upgrade_tce.sh script that takes a slightly different approach.
Instead of booting in a "failsafe" mode, I just upgrade the files in the tce directory, so the updated packages will be loaded only after a reboot.
I hope, it's useful for someone here. It's also attached for easier downloading.
Greetings,
SvOlli
#!/bin/sh
tmpdir=/tmp/update.tce
tcedir="$(cat /opt/.tce_dir)"
export $(sed 's/: /=/' </opt/.tcrc)
baseurl="${Protocol}://${Mirror}"
. /etc/init.d/tc-functions
check()
{
p=${4%.md5.txt}
wget -q -c ${2}/${3}/${4} 2>/dev/null
if [ ! -f ${4} ]; then
echo ${1}/${p} ${RED}not found${NORMAL}
return
fi
if cmp -s ${1}/${4} ${4}; then
echo ${1}/${p} ${GREEN}current${NORMAL}
else
wget -c ${2}/${3}/${p}
rm ${1}/${p} ${1}/${4}
mv ${p} ${4} ${1}
echo ${1}/${p} ${YELLOW}updated${NORMAL}
fi
}
tceget()
{
for i in $(cd ${1};echo *.md5.txt); do
case ${i} in
*.tce*) check ${1} ${baseurl} tce ${i} ;;
*.tcz*) check ${1} ${baseurl} tcz ${i} ;;
*) echo ${RED}${i} unknown${NORMAL};;
esac
done
}
mkdir -p ${tmpdir}
cd ${tmpdir}
[ -d ${tcedir} ] && tceget ${tcedir}
[ -d ${tcedir}/optional ] && tceget ${tcedir}/optional
cd ..
rm -r ${tmpdir}