forked from abraxas/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcentos-install
More file actions
executable file
·22 lines (21 loc) · 867 Bytes
/
centos-install
File metadata and controls
executable file
·22 lines (21 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
pushd `dirname $0` > /dev/null
dotfiles_dir=`pwd -P`
popd > /dev/null
user="${1:-`whoami`}"
home_dir=$(eval echo "~${user}")
echo "Installing dotfiles for $user"
pushd $home_dir > /dev/null
sudo chsh -s `grep -i zsh /etc/shells | head -1` $user;
pushd $dotfiles_dir
for x in vim zsh ipython ; do
pushd "${dotfiles_dir}/$x"
sudo -u $user rsync -rlvtD --no-p "./" $home_dir
find . -type f -exec sudo chmod 0600 "$home_dir/{}" \;
find . -type d -exec sudo chmod 0700 "$home_dir/{}" \;
done
if [[ -f ${dotfiles_dir}/zsh/$user.zsh_aliases ]]; then
sudo -u $user cp ${dotfiles_dir}/zsh/$user.zsh_aliases $home_dir/.zsh_aliases
fi
cat ${dotfiles_dir}/zsh/dbuy.zsh_aliases >>$home_dir/.zsh_aliases
find "${home_dir}" -mindepth 1 -type d -\! -name '.cache' -prune -\! -name 'pip' -prune -\! -name '.npm' -prune -exec sudo chmod 0700 {} \;