-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·40 lines (34 loc) · 1.18 KB
/
install.sh
File metadata and controls
executable file
·40 lines (34 loc) · 1.18 KB
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
count=1
pyV1=`python3 --version | cut --delimiter=" " --fields 2 | cut --delimiter="." --fields=1`
pyV2=`python3 --version | cut --delimiter=" " --fields 2 | cut --delimiter="." --fields=2`
if [ $pyV1 -ne 3 ] && [ $pyV2 -lt 6 ];then
echo "[$count] Python Version $pyV1.$pyV2 not supported"
exit -1
fi
currDir=`pwd`
file=".bash_aliases"
echo "[$count] Checking for .bash_aliases"
let "count++"
if [ -f ~/$file ];then
echo "[$count] $file found"
let "count++"
echo "#The next two lines are for Pulogin" >> ~/$file
echo "alias pulogin='python3 $currDir/pulogin.py'" >> ~/$file
echo "alias pulogout='python3 $currDir/pulogout.py'" >> ~/$file
echo "[$count] Successful! Now type pulogin for login and pulogout for logout in shell"
source ~/.bashrc
exit 0
else
echo "[$count] $file not found"
let "count++"
echo "[$count] Creating $file in ~/ directory"
let "count++"
touch ~/$file
echo "#The next two lines are for Pulogin" >> ~/$file
echo "alias pulogin='python3 $currDir/pulogin.py'" >> ~/$file
echo "alias pulogout='python3 $currDir/pulogout.py'" >> ~/$file
echo "[$count] Successful! Now type pulogin for login and pulogout for logout in shell"
source ~/.bashrc
exit 0
fi