#! /bin/sh
+KNOWNMDSUMS=b5239e7dfbecaf832e18a5377b794b09
+
DOTFILESDIR=$HOME/dotfiles
MD5SUM=`which md5sum`
if test -z "$MD5SUM"; then
continue
fi
if test -f $HOME/.$file; then
- C_MD5SUM=`$MD5SUM < $HOME/.$file`
- N_MD5SUM=`$MD5SUM < $DOTFILESDIR/$file`
+ C_MD5SUM=`$MD5SUM < $HOME/.$file | awk '{print $1}'`
+ N_MD5SUM=`$MD5SUM < $DOTFILESDIR/$file | awk '{print $1}'`
if test "$C_MD5SUM" = "$N_MD5SUM"; then
rm -f $HOME/.$file
else
- echo "$HOME/.$file different from $DOTFILESDIR/$file, and not symlink skipping"
- continue
+ found=0
+ for md5 in $KNOWNMD5SUMS; do
+ if [ "$md5" = "$C_MD5SUM" ]; then
+ rm -f $HOME/.$file
+ found=1
+ break
+ fi
+ done
+ if [ "$found" = "0" ]; then
+ echo "$HOME/.$file different from $DOTFILESDIR/$file, not known ok, and not symlink: skipping"
+ continue
+ fi
fi
fi
- ln -s $DOTFILESDIR/$file $HOME/.$file
+ ln -s $DOTFILESDIR/$file $HOME/.$file
done
\ No newline at end of file