4
4
# written by how2flow(Steve Jeong).
5
5
6
6
ID=" ${1:- user} "
7
- GROUP =" ${2:- user } "
8
- PASSWORD =" ${3:- docker } "
7
+ PASSWORD =" ${2:- docker } "
8
+ GROUP =" ${3:- user } "
9
9
10
- ROOT=" $( cd $( dirname $0 ) ; pwd -P ) "
11
- . " ${ROOT} " /global
12
-
13
- get_app_configs () {
10
+ download_app_configs () {
14
11
local home=" /home/" ${ID} " "
15
12
16
- # move configs
17
- if [[ -d " ${CONFDIR} " && -d " ${home} " ]]; then
18
- mv " ${CONFDIR} " /* " ${home} "
13
+ if [ ! -d " ${home} " ]; then
14
+ echo " There is no account..."
19
15
fi
20
16
21
- rm -rf " ${CONFDIR} "
17
+ # download configs
18
+ if [ -x " $( command -v wget) " ]; then
19
+ wget -O " ${home} " /.gitconfig $WGET_FLAG " https://raw.githubusercontent.com/how2flow/config/master/ubuntu/gitconfig"
20
+ wget -O " ${home} " /.tmux.conf $WGET_FLAG " https://raw.githubusercontent.com/how2flow/config/master/ubuntu/tmux.conf"
21
+ wget -O " ${home} " /.vimrc $WGET_FLAG " https://raw.githubusercontent.com/how2flow/config/master/ubuntu/vimrc"
22
+
23
+ # download configs for vim plugin.
24
+ mkdir -p " ${home} " /.vim/colors " ${CONFDIR} " /.vim/bundle
25
+ echo " git 1"
26
+ git clone " https://github.com/VundleVim/Vundle.vim.git" " ${home} " /.vim/bundle/Vundle.vim
27
+ echo " git 2"
28
+ wget -O " ${home} " /.vim/colors/gruvbox.vim $WGET_FLAG " https://raw.githubusercontent.com/morhetz/gruvbox/master/colors/gruvbox.vim"
29
+ fi
22
30
23
31
echo " Finish Download app configs"
24
32
}
@@ -45,8 +53,8 @@ rc_config() {
45
53
46
54
# bashrc user confs
47
55
if [ -f " ${bashrc} " ]; then
48
- echo " alias tmux='tmux -2'" >> " ${bashrc} " /dev/null 2>&1
49
- echo " set -o vi" >> " ${bashrc} " /dev/null 2>&1
56
+ echo " alias tmux='tmux -2'" >> " ${bashrc} " > /dev/null 2>&1
57
+ echo " set -o vi" >> " ${bashrc} " > /dev/null 2>&1
50
58
fi
51
59
52
60
echo " Finish rc config"
@@ -62,7 +70,7 @@ sudo_config() {
62
70
fi
63
71
64
72
# sudoers config
65
- echo " %$id ALL=(ALL) ALL" >> " ${sudoers_conf} "
73
+ echo " %$ID ALL=(ALL) ALL" >> " ${sudoers_conf} "
66
74
67
75
echo " Finish sudo config"
68
76
}
@@ -71,7 +79,7 @@ main() {
71
79
id_config
72
80
rc_config
73
81
sudo_config
74
- get_app_configs
82
+ download_app_configs
75
83
}
76
84
77
85
main
0 commit comments