forked from cscshared/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-install
More file actions
29 lines (27 loc) · 750 Bytes
/
docker-install
File metadata and controls
29 lines (27 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
function go {
pushd `dirname $0` > /dev/null
local dirname=`pwd -P`
popd > /dev/null
local user=""
local home_dir=""
if [ "$1" = "" ] ; then
user=`whoami` ;
else
user=$1;
fi ;
echo "Installing dotfiles for $user"
home_dir=$(eval echo "~${user}")
pushd $home_dir > /dev/null
if [ ! -e /bin/zsh ] ; then
yum -y install zsh > /dev/null
fi
chsh -s `grep -i zsh /etc/shells` $user;
rsync -rltD "${dirname}/vim/" "${home_dir}"
rsync -rltD "${dirname}/zsh/" "${home_dir}"
rsync -rltd "${dirname}/ipython/" "${home_dir}"
rsync -rltd "${dirname}/screen/" "${home_dir}"
chown -R "${user}:${user}" "${home_dir}"
find "${home_dir}" -mindepth 1 -maxdepth 1 -type d -exec chmod 0700 {} \;
}
go $1