-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.sh
executable file
·61 lines (52 loc) · 1.23 KB
/
script.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
skeletonC=skeleton.c
skeletonCPP=skeleton.cpp
#Check net connectivity
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]
then
echo "No internet access found."
exit 0
else
echo "Internet Connectivity Found..."
fi
if [ ! -f ~/.vimrc ]
then
echo ".vimrc File not found!!!"
echo "Generating new .vimrc Config file...."
cp ./.vimrc ~/.vimrc
#checking for successfull execution of a command.
if [ $? -eq 0 ]; then
echo ".vimrc Config file generated successfully..."
else
echo "There was some problem in generating .vimrc config file..."
fi
else
mv ~/.vimrc ~/.vimrc.old
cp ./.vimrc ~/.vimrc
fi
if [ ! -d "~/.vim" ]
then
mkdir ~/.vim
fi
if [ ! -f ~/.vim/$skeletonCPP ]
then
# Control will enter here if .vim exists.
cp ./$skeletonCPP ~/.vim/
fi
if [ ! -f ~/.vim/$skeletonC ]
then
cp ./$skeletonC ~/.vim/
fi
if [ ! -d "~/.vim/bundle" ]
then
mkdir ~/.vim/bundle
cd ~/.vim/bundle
#cd ~/.vim
mkdir ~/.vim/plugin
#cd ~/.vim/plugin
#installs nerd commentor which a vim plugin for easy commenting
git clone https://github.com/scrooloose/nerdcommenter.git
cp ~/.vim/bundle/nerdcommenter/plugin/NERD_commenter.vim ~/.vim/plugin/
rm -rf ~/.vim/bundle/nerdcommenter
fi