]> git.donarmstrong.com Git - bin.git/blob - new_home_directory
* remove .bash_logout; handle non-existance
[bin.git] / new_home_directory
1 #!/bin/sh
2
3 # makes a new home directory; defaults to one that does not use ssh
4 SVN_BASE=http://svn.donarmstrong.com/don/trunk
5
6 # check out bin and lib
7 cd ~;
8 svn co $SVN_BASE/bin
9 svn co $SVN_BASE/lib
10
11 # check out the .home modules
12 mkdir .home_modules;
13 (
14     cd .home_modules;
15     svn co $SVN_BASE/home_modules/base;
16     for module in $@; do
17         svn co $SVN_BASE/home_modules/$module;
18     done;
19 )
20 # make a home backup directory
21 mkdir home_backup;
22 for a in .wgetrc .svn .sversionrc .subversion .bash_profile .bash_logout .bashrc .ssh; do
23     if [ -e $a ]; then
24         mv $a home_backup/;
25     fi;
26 done;
27 mkdir .sa.d;
28 ln -s ~/.home_modules/*/sa_* .sa.d/;
29 # run the appropriate command to set the symlinks correctly
30 ~/bin/sa --hooks-only update
31 cat -<<EOF> .sa.d/sa_local
32 ~/bin
33 ~/lib
34 EOF
35 # move back the .ssh stuff
36 if [ -e home_backup/.ssh ]; then
37     cp -f home_backup/.ssh/* .ssh/;
38 fi;
39 exec ~/bin/sa update;