-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver-setup.sh
executable file
·57 lines (45 loc) · 1.26 KB
/
server-setup.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
#!/bin/bash
if test "$(whoami)" != "ran"; then
printf "\n";
printf "ERROR! this script must run as user 'ran'.\n"
printf "\n";
printf "* ************************\n";
printf "* CREATE USER 'ran' \n";
printf "*\n";
printf "* useradd -m ran\n";
printf "* passwd user ran\n";
printf "*\n";
printf "* visudo\n";
printf "* ran ALL=(All) ALL\n";
printf "*\n";
printf "* cp -r /root/.ssh /home/ran\n";
printf "* chmod 644 /home/ran/.ssh/*\n";
printf "*\n";
printf "* ************************\n";
exit 1
fi
set -e
source ./scripts/func-util.sh
function check_command {
if ! which $1 > /dev/null 2>&1; then
printf "\e[31m⭑\e[0m command not found: \e[31m%s\e[0m \n" $1
exit 0
fi
}
__current_status "must-have tools"
must_have_tools=(vim git wget)
for tool in "${must_have_tools[@]}"; do
__current_status "check ${tool}"
check_command ${tool}
done
__current_status "linking dotfiles"
dotfiles=(.bashrc .vimrc)
for file in "${dotfiles[@]}"; do
__current_status "linking ${file}"
__link_file ~/dotfiles/$file ~/$file
done
source ~/.bashrc
__current_status "successfully install 🚀"
printf "\n"
printf "1. now you can source ~/.bashrc\n"
printf "2. change yum.repos.d"