X-Git-Url: https://plomlompom.com/repos/bar%20baz.html?a=blobdiff_plain;f=symlink.sh;h=1b966ef2d650ce73c26069cc413a5b0a36259484;hb=8db1ace1141713a4199422eab83574c1f5e94a08;hp=abb261c633662b7d622e46a934bb16bff1675274;hpb=842cf63728159ac528309278c51f5390c4b02574;p=config diff --git a/symlink.sh b/symlink.sh old mode 100644 new mode 100755 index abb261c..1b966ef --- a/symlink.sh +++ b/symlink.sh @@ -1,7 +1,16 @@ #!/bin/sh +set -x + dir=~/config/dotfiles -cd ~ -for file in $dir; do +dir_root=~/config/dotfiles_root +homedir=`echo ~` +find ~ -lname $homedir'/config/*' -delete +for file in `ls $dir`; do ln -s $dir/$file ~/.$file done +if [ "$(id -u)" -eq "0" ]; then + for file in `ls $dir_root`; do + ln -fs $dir_root/$file ~/.$file + done +fi