Added initial stat command
[clearscm.git] / rc / setup_rc
index 14fc987..b80e287 100755 (executable)
@@ -53,6 +53,18 @@ if [ ! -d $HOME/.rc ]; then
   exit 1
 fi
 
+# Check to see if we were already setup
+symlink=$(stat -c %N ~/.bashrc | awk '{print $2}')
+
+if [ "$symlink" = "->" ]; then
+  to=$(stat -c %N ~/.bashrc | awk '{print $NF}')
+
+  if [[ "$to" =~ .rc\/bash_login ]]; then
+    echo "Already setup"
+    exit
+  fi
+fi
+
 ReplaceFile "$HOME/.Xdefaults"   "$HOME/.rc/Xdefaults"
 ReplaceFile "$HOME/.bash_login"          "$HOME/.rc/bash_login"
 ReplaceFile "$HOME/.bashrc"          "$HOME/.rc/bash_login"