-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
56 lines (44 loc) · 1013 Bytes
/
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
mkdir Script/output
mkdir -p /home/bin/P1/Script
cp -a Script/. /home/bin/P1/Script
cp -a Project-1.py /home/bin/P1
chmod +x /home/bin/P1/Project-1.py
file="/etc/profile"
if grep -qF 'export PATH="$PATH:/home/bin/P1"' "$file";then
:
else
echo 'export PATH="$PATH:/home/bin/P1"' >> "$file"
fi
source /etc/profile
echo $PATH
String1="Host *"
String2=" StrictHostKeyChecking no"
String3=" KexAlgorithms=+diffie-hellman-group1-sha1"
file="/root/.ssh/config"
if grep -qF "$String1" "$file";then
:
else
echo "$String1" >> "$file"
fi
if grep -qF "$String2" "$file";then
:
else
echo "$String2" >> "$file"
fi
if grep -qF "$String3" "$file";then
:
else
echo "$String3" >> "$file"
fi
sudo apt update
sudo apt install python3-pip
pip3 --version
pip3 install netmiko
while true; do
read -p "Do you want to delete setup directory [y/n]?" yn
case $yn in
[Yy]* ) cd ..;rm -Rf P1; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done