#!/bin/ash echo "Update launched, waiting 3 minutes to start." sleep 180 rootdomain=`readlink /bin` fsroot=${rootdomain%/bin} domonly=${fsroot#/http/} echo "Beginning update process for $fsroot ..." files="" while read filename etag do #echo "$filename $etag" if grep -q $etag /.crestcache/.crestfs_metadata_rootnode/$domonly/$filename then #echo "$filename NOT MODIFIED" echo -n "." else #echo "$filename has been changed, refetching..." echo -n "*" files="$files $filename" head -c 1 $fsroot/$filename > /dev/null fi done < $fsroot/manifest echo "" for f in $files do echo "$f" done echo "FINISHED withfiles update, checking /etc/ directory." funnyfiles="mtab resolv.conf davfs2" for linkfile in `ls -1 $fsroot/etc/` do #echo "Server file is: $linkfile." etcfile=`basename $linkfile` #echo "baes name: $etcfile" etctarget=`readlink /etc/$etcfile` #echo "Target is: $etctarget" for skip in $funnyfiles do if [ $skip == $etcfile ] then #echo "Skipping file $skip ($linkfile)" continue 2 fi done if [ "$etctarget" != "$fsroot/etc/$linkfile" ] then echo "Server: $linkfile Current Target: $etctarget" #echo "Relinking $etctarget" ln -sf $fsroot/etc/$linkfile /etc/$linkfile fi done echo checking "Finished with /etc/, now moving on to kernel" md5sum /boot/bzImage md5sum /boot/grub/grub.conf