annotate setup @ 4:94ee419ad047

Added bin-ec - a collection of scripts.
author Edho Prima Arief <me@myconan.net>
date Sat, 10 Jul 2010 12:38:52 +0000
parents 39ef7f7236fc
children de6ce93d40fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
1 #!/bin/sh
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
2
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
3 install() {
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
4 #create symlinks
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
5 linker "tcsh" ".tcsh_init"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
6 linker "tmux" ".tmux.conf"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
7 linker "hg" ".hgrc"
3
39ef7f7236fc Added vimrc.
Edho Prima Arief <me@myconan.net>
parents: 1
diff changeset
8 linker "vim" ".vimrc"
4
94ee419ad047 Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents: 3
diff changeset
9 linker "bin" "bin-ec"
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
10
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
11 #modify cshrc
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
12 uninstall_tcsh
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
13 echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> "${HOME}/.cshrc"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
14 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
15
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
16 linker() {
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
17 ln -fs "${PWD}/${1}" "${HOME}/${2}"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
18 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
19
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
20 uninstall_tcsh() {
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
21 if [ -e "${HOME}/.cshrc" ]; then
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
22 grep -v '#ECCORE_TCSH' "${HOME}/.cshrc" > .cleancshrc
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
23 mv .cleancshrc "${HOME}/.cshrc"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
24 fi
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
25 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
26
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
27 uninstall() {
3
39ef7f7236fc Added vimrc.
Edho Prima Arief <me@myconan.net>
parents: 1
diff changeset
28 for i in .tcsh_init .tmux_conf .hgrc .vimrc; do
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
29 [ -e "${HOME}/${i}" ] && rm -f "${HOME}/${i}"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
30 done
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
31 uninstall_tcsh
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
32 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
33
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
34 case "$1" in
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
35 install)
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
36 install
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
37 ;;
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
38 uninstall)
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
39 uninstall
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
40 ;;
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
41 esac