#!/bin/bash # breaks at diff #set -e day=`date +%Y-%m-%d` # need to evaluate previous folder name/date BEFORE we create the new one lastpath=`find /root/lab/confdiff/ -type d -maxdepth 1 | \ grep -E '[[:digit:]]+-[[:digit:]]+-[[:digit:]]+' | \ grep -v $day | sort | tail -1` last=${lastpath##*/} echo last is $last workdir=/data/www/lab.nethence.com/confdiff/$day/ echo workdir is $workdir mkdir -p $workdir/patch/ cd $workdir/ mirror=`grep -vE '^#|^$' /etc/slackpkg/mirrors` echo mirror is $mirror wget -q $mirror/kernels/VERSIONS.TXT wget -q $mirror/kernels/huge.s/config sort config > config.sort pkg=`wget -q -O - $mirror/patches/FILE_LIST | grep -E 'kernel-huge-.*.txz$' | awk '{print $NF}'` echo pkg is $pkg wget -q -O - $mirror/patches/$pkg | tar xJf - -C patch/ rm -f patch/boot/vmlinuz-* cd ../ sort $day/patch/boot/config-huge-* > $day/patch/boot/config-huge.sort diff $day/config.sort $day/patch/boot/config-huge.sort > $day-since-release.txt ln -sf $day/patch/boot/config-huge-* config diff $last/patch/boot/config-huge.sort $day/patch/boot/config-huge.sort > $day-since-$last.txt cat <