2013-06-01 23:07:50 +00:00
|
|
|
#!/bin/bash
|
2013-12-28 02:21:07 +00:00
|
|
|
set -x
|
2013-12-09 20:56:04 +00:00
|
|
|
function deploy_directory()
|
|
|
|
{ # {{{
|
|
|
|
# @arg1: dst directory
|
|
|
|
# @arg2: src directory
|
|
|
|
|
|
|
|
if [ ! -d $1 ]; then mkdir $1; fi;
|
|
|
|
cd $1;
|
|
|
|
|
|
|
|
for i in `ls $2`; do ln -s $2/$i ./$i; done
|
|
|
|
cd ..
|
|
|
|
} # }}}
|
|
|
|
|
2013-12-28 22:17:56 +00:00
|
|
|
function deploy_encryption()
|
|
|
|
{
|
|
|
|
cd ~
|
|
|
|
mkdir $SECURE_DIR/.mozilla
|
|
|
|
ln -s $SECURE_DIR/.mozilla ~./.mozilla
|
|
|
|
}
|
|
|
|
|
2013-08-22 14:26:45 +00:00
|
|
|
function deploy_for_desktop()
|
|
|
|
{ # {{{
|
|
|
|
cd ~
|
|
|
|
ln -s $WAI/xinitrc ./.xinitrc
|
2014-11-16 13:55:00 +00:00
|
|
|
ln -s $WAI/xbindkeysrc ./.xbindkeysrc
|
2013-11-11 20:48:13 +00:00
|
|
|
ln -s $WAI/inputrc ./.inputrc
|
2013-08-22 19:28:44 +00:00
|
|
|
ln -s $WAI/Xmodmap ./.Xmodmap
|
2013-08-22 14:26:45 +00:00
|
|
|
ln -s $WAI/octaverc ./.octaverc
|
2014-01-02 22:55:00 +00:00
|
|
|
ln -s $WAI/lynxrc ./.lynxrc
|
2013-08-22 14:26:45 +00:00
|
|
|
|
2013-12-09 20:56:04 +00:00
|
|
|
cd ~
|
|
|
|
deploy_directory ~/texmf $WAI/texmf
|
|
|
|
|
2013-08-22 14:26:45 +00:00
|
|
|
cd ~
|
|
|
|
if [ ! -d "~/.my_utils" ]; then mkdir ~/.my_utils; fi;
|
|
|
|
cd ~/.my_utils
|
|
|
|
ln -s $WAI/Utils/track.sh ./track.sh
|
|
|
|
ln -s $WAI/Utils/blink.sh ./blink.sh
|
|
|
|
ln -s $WAI/Utils/octopus.sh ./octopus.sh
|
|
|
|
|
|
|
|
|
|
|
|
ln -s $WAI/chooseWP.sh ~/Pictures/wallpapers/chooseWP.sh
|
|
|
|
} # }}}
|
|
|
|
|
|
|
|
function deploy_vim()
|
|
|
|
{ # {{{
|
|
|
|
|
|
|
|
cd ~
|
|
|
|
ln -s $WAI/vim/vimrc ./.vimrc
|
2015-04-09 16:47:24 +00:00
|
|
|
ln -s $WAI/vim ./.vim
|
2013-08-22 14:26:45 +00:00
|
|
|
|
|
|
|
} # }}}
|
|
|
|
|
|
|
|
function deploy_ssh()
|
|
|
|
{ # {{{
|
2013-12-28 02:21:07 +00:00
|
|
|
cd ~
|
|
|
|
if [ -d ~/.ssh && ! -h ~/.ssh ]; then
|
|
|
|
mv ~/.ssh ~/.sshBAK
|
|
|
|
fi;
|
|
|
|
|
|
|
|
if [ ! -d "$SECURE_DIR/.ssh/" ]; then
|
|
|
|
mkdir "$SECURE_DIR/.ssh"
|
|
|
|
if [ -d ~/.sshBAK ]; then #could've reversed 2 ifs, i know
|
|
|
|
mv ~/.sshBAK/* $SECURE_DIR/.ssh/
|
|
|
|
rm -f ~/.sshBAK
|
|
|
|
fi;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
ln -s $SECURE_DIR/.ssh/ ~/.ssh
|
|
|
|
|
2013-08-22 14:26:45 +00:00
|
|
|
cd ~/.ssh
|
|
|
|
ln -s $WAI/ssh/config ./
|
|
|
|
} # }}}
|
|
|
|
|
|
|
|
function deploy_mutt()
|
|
|
|
{ # {{{
|
|
|
|
cd ~
|
|
|
|
ln -s $WAI/mailcap ./.mailcap
|
2013-06-01 23:14:47 +00:00
|
|
|
|
2013-12-28 02:21:07 +00:00
|
|
|
if [ -d ~/.mutt && ! -h ~/.mutt ]; then
|
|
|
|
mv ~/.mutt ~/.muttBAK
|
|
|
|
fi;
|
|
|
|
|
|
|
|
if [ ! -d $SECURE_DIR/.mutt ]; then
|
|
|
|
mkdir $SECURE_DIR/.mutt;
|
|
|
|
if [ -d ~/.muttBAK ]; then
|
|
|
|
mv ~/.muttBAK/* $SECURE_DIR/.mutt/
|
|
|
|
fi;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
if [ ! -h ~/.mutt ]; then
|
|
|
|
ln -s $SECURE_DIR/.mutt/ ~/.mutt/
|
|
|
|
fi
|
|
|
|
|
2013-08-22 14:26:45 +00:00
|
|
|
cd ~/.mutt
|
|
|
|
ln -s $WAI/mutt/muttrc ./
|
|
|
|
ln -s $WAI/mutt/killsig ./
|
|
|
|
ln -s $WAI/mutt/passwords.gpg ./
|
|
|
|
ln -s $WAI/mutt/crypto ./
|
|
|
|
ln -s $WAI/mutt/colors.test1 ./
|
|
|
|
ln -s $WAI/mutt/colors.test2 ./
|
|
|
|
ln -s $WAI/mutt/unlock-pass.sh ./
|
2013-10-06 17:55:14 +00:00
|
|
|
ln -s $WAI/mutt/account.frank ./
|
|
|
|
ln -s $WAI/mutt/account.aei ./
|
2013-12-28 02:21:07 +00:00
|
|
|
|
|
|
|
mkdir ~/.mutt/certificates
|
|
|
|
mkdir ~/.mutt/cache
|
|
|
|
mkdir ~/.mutt/cache/bodies
|
|
|
|
mkdir ~/.mutt/cache/headers
|
2013-08-22 14:26:45 +00:00
|
|
|
} # }}}
|
|
|
|
|
|
|
|
|
|
|
|
WAI=`pwd`
|
2013-06-02 19:31:03 +00:00
|
|
|
|
2013-12-28 02:21:07 +00:00
|
|
|
if [ $(hostname) = "intersect" ]; then
|
|
|
|
SECURE_DIR=~/Private
|
|
|
|
else
|
|
|
|
SECURE_DIR=~
|
|
|
|
echo "FIXME"
|
|
|
|
exit
|
|
|
|
fi;
|
|
|
|
|
2013-06-02 19:31:03 +00:00
|
|
|
#simple files
|
2013-08-22 14:26:45 +00:00
|
|
|
cd ~
|
2015-04-09 16:47:24 +00:00
|
|
|
ln -s $WAI/Utils/ .my_utils
|
2013-06-01 23:14:47 +00:00
|
|
|
ln -s $WAI/bashrc ./.bashrc
|
2013-09-11 14:43:52 +00:00
|
|
|
ln -s $WAI/bash_ps1 ./.bash_ps1
|
2014-08-05 16:06:31 +00:00
|
|
|
ln -s $WAI/signature ./.signature
|
2015-04-09 16:47:24 +00:00
|
|
|
ln -s $WAI/gitconfig ./.gitconfig
|
2014-08-05 16:06:31 +00:00
|
|
|
ln -s $WAI/vacation.msg ./.vacation.msg
|
2013-08-22 14:26:45 +00:00
|
|
|
|
2015-04-09 16:47:24 +00:00
|
|
|
#deploy_for_desktop
|
|
|
|
#deploy_encryption
|
2013-08-22 14:26:45 +00:00
|
|
|
deploy_vim
|
|
|
|
deploy_ssh
|
2015-04-09 16:47:24 +00:00
|
|
|
#deploy_mutt
|
2013-08-22 14:26:45 +00:00
|
|
|
|
|
|
|
|
2013-06-11 22:42:55 +00:00
|
|
|
cd ~
|
2013-06-25 23:22:52 +00:00
|
|
|
if [ -d "Programmation" ]; then mkdir Programmation; fi;
|
2013-06-04 16:43:31 +00:00
|
|
|
cd ~/Programmation
|
2013-07-03 23:48:39 +00:00
|
|
|
ln -s $WAI/git_auto_pull.sh ./git_auto_pull.sh
|
2013-08-22 14:26:45 +00:00
|
|
|
|
|
|
|
|