-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
49 lines (38 loc) · 1.14 KB
/
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
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
server=https://raw.githubusercontent.com/gzz2000/RoSSH/master
local=$HOME/.rossh
echo "Will install RoSSH to $HOME/.rossh"
read -p "Proceed? (y/n)" -n 1 -r
echo
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
exit
fi
mkdir -p $local
for filename in rossh rossh_client.py rossh_server.py rossh_common.py LICENSE; do
echo "Downloading $filename"
curl -s $server/$filename --output $local/$filename
done
chmod +x $local/rossh*
if [[ ":$PATH:" == *":$HOME/.local/bin:"* ]]; then
echo "Putting rossh executable to $HOME/.local/bin."
ln -fs $local/rossh $HOME/.local/bin
echo "Done."
exit
fi
if [[ ":$PATH:" == *":$HOME/bin:"* ]]; then
echo "Putting rossh executable to $HOME/bin."
ln -fs $local/rossh $HOME/bin
echo "Done."
exit
fi
read -p "Add rossh executable to ~/.local/bin? (y/n)" -n 1 -r
echo
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "You can manually add $local/rossh to your path later."
exit
fi
mkdir -p $HOME/.local/bin
ln -fs $local/rossh $HOME/.local/bin
echo "Done. Please add the following line to your .bashrc, and then relogin to use RoSSH:"
echo ""
echo "export PATH=\"\$PATH:$HOME/.local/bin\""