]> err.no Git - dotfiles/commitdiff
Initial commit
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Thu, 26 Sep 2002 08:19:59 +0000 (08:19 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Thu, 26 Sep 2002 08:19:59 +0000 (08:19 +0000)
git-svn-id: file:///svn/tfheen/trunk/dotfiles@9 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

link-dotfiles [new file with mode: 0755]

diff --git a/link-dotfiles b/link-dotfiles
new file mode 100755 (executable)
index 0000000..e3b0679
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+DOTFILESDIR=$HOME/dotfiles
+MD5SUM=`which md5sum`
+
+if test ! -d $DOTFILESDIR; then
+    echo "$DOTFILESDIR does not exist!  exiting"
+    exit 1
+fi
+
+if test -z "$MD5SUM"; then
+    echo "Cannot find md5sum program"
+    exit 1
+fi
+
+for file in $DOTFILESDIR/*; do
+    if test -f $HOME/.$file; then
+        C_MD5SUM=`$MD5SUM < $HOME/.$file`
+        N_MD5SUM=`$MD5SUM < $DOTFILESDIR/$file`
+        if test "$C_MD5SUM" = "$N_MD5SUM"; then
+            rm -f $HOME/.$file
+        else
+            echo "$HOME/.$file different from $DOTFILESDIR/$file, and not symlink skipping"
+            continue
+        fi
+        ln -s $DOTFILESDIR/$file $HOME/.$file
+done
\ No newline at end of file