-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·40 lines (32 loc) · 767 Bytes
/
setup.sh
File metadata and controls
executable file
·40 lines (32 loc) · 767 Bytes
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
#!/usr/bin/env bash
if [ $(id -u) -ne 0 ]; then
SUDO="sudo"
fi
if which apt-get >/dev/null; then
$SUDO apt-get install -y git dialog expect
elif which yum >/dev/null; then
$SUDO yum install -y git dialog expect
elif which brew >/dev/null; then
brew install git dialog expect
fi
if [ "$0" = "sh" ]; then
cd ~ && git clone https://github.com/luyuhuang/myssh.git .myssh && cd .myssh
if [ $? -ne 0 ]; then
echo FAILED
exit 1
fi
fi
dir=$(pwd)
$SUDO ln -s $dir/myssh /usr/local/bin/myssh
if [ $? -ne 0 ]; then
echo FAILED
exit 1
fi
cat << EOF
-------------------------------------
MySSH have been installed in:
/usr/local/bin
Use 'myssh -h' to print usage.
enjoy it!
-------------------------------------
EOF