home · contact · privacy
Unity symlink scripts.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 3 May 2015 03:00:10 +0000 (05:00 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 3 May 2015 03:00:10 +0000 (05:00 +0200)
symlink.sh
symlink_root.sh [deleted file]

index 9343880d057918d81c4f0999c5b6523c1ada5459..a78b1dec9ad57240b49b7367db5623c558fb6d2d 100755 (executable)
@@ -1,7 +1,12 @@
 #!/bin/sh
 
 dir=~/config/dotfiles
-cd ~
+dir_root=~/config/dotfiles_root
 for file in `ls $dir`; do
     ln -fs $dir/$file ~/.$file
 done
+if [ "$(id -u)" -ne "0" ]; then
+    for file in `ls $dir_root`; do
+        ln -fs $dir_root/$file ~/.$file
+    done
+fi
diff --git a/symlink_root.sh b/symlink_root.sh
deleted file mode 100755 (executable)
index 09cff77..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-dir=~/config/dotfiles_root
-cd ~
-for file in `ls $dir`; do
-    ln -fs $dir/$file ~/.$file
-done