-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
39 lines (28 loc) · 851 Bytes
/
install.sh
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
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# run (as root) like: bash install.sh readerbound
if [[ "$EUID" -ne 0 ]]; then
echo "This has to be run as root"
exit 1
fi
plainuser="$1"
homefolder="/home/$plainuser"
if [ ! -d "$homefolder" ]
then
echo "Home folder does not exist: "$homefolder
exit 1
fi
yum -y install vim-enhanced
cd "$homefolder"
if [ ! -d "$homefolder/dfp-dotfiles" ]
then
git clone https://github.com/dougplant/dfp-dotfiles.git
fi
chown -R $plainuser:$plainuser dfp-dotfiles/
sed -i '/^alias dfp/d' .bashrc
echo "alias dfp='. $homefolder/dfp-dotfiles/.bashrc_dfp'" >> $homefolder/.bashrc
sed -i '/^alias dfp/d' /root/.bashrc
echo "alias dfp='. $homefolder/dfp-dotfiles/.bashrc_dfp'" >> /root/.bashrc
# create symlink so that the vi/vim aliases point at the single vimrc file
cd /root
rm -f dfp-dotfiles
ln -s $homefolder/dfp-dotfiles/