X-Git-Url: https://plomlompom.com/repos/bar%20baz.html?a=blobdiff_plain;f=symlink.sh;h=1b966ef2d650ce73c26069cc413a5b0a36259484;hb=8db1ace1141713a4199422eab83574c1f5e94a08;hp=9343880d057918d81c4f0999c5b6523c1ada5459;hpb=0ca4a530f49d5b15acccab40cad58ceb00327f7c;p=config diff --git a/symlink.sh b/symlink.sh index 9343880..1b966ef 100755 --- a/symlink.sh +++ b/symlink.sh @@ -1,7 +1,16 @@ #!/bin/sh +set -x + dir=~/config/dotfiles -cd ~ +dir_root=~/config/dotfiles_root +homedir=`echo ~` +find ~ -lname $homedir'/config/*' -delete for file in `ls $dir`; do - ln -fs $dir/$file ~/.$file + 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