Commit 3da2d5587faf639b08041f198fddecae728a7283
Committed by
GitHub
1 parent
54d9caed
Exists in
master
Update install_ngrok.sh
Showing
1 changed file
with
12 additions
and
12 deletions
Show diff stats
install_ngrok.sh
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | 8 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin |
9 | export PATH | 9 | export PATH |
10 | shell_run_start=`date "+%Y-%m-%d %H:%M:%S"` #shell run start time | 10 | shell_run_start=`date "+%Y-%m-%d %H:%M:%S"` #shell run start time |
11 | -version="4.1" | 11 | +version="4.2" |
12 | program_download_url=https://raw.githubusercontent.com/clangcn/ngrok-one-key-install/master/latest/ | 12 | program_download_url=https://raw.githubusercontent.com/clangcn/ngrok-one-key-install/master/latest/ |
13 | x64_file=server_ngrokd_linux_amd64 | 13 | x64_file=server_ngrokd_linux_amd64 |
14 | x86_file=server_ngrokd_linux_386 | 14 | x86_file=server_ngrokd_linux_386 |
@@ -125,7 +125,7 @@ function check_os_bit(){ | @@ -125,7 +125,7 @@ function check_os_bit(){ | ||
125 | fi | 125 | fi |
126 | } | 126 | } |
127 | function check_curl(){ | 127 | function check_curl(){ |
128 | - curl -V >/dev/null | 128 | + curl -V >/dev/null 2>&1 |
129 | if [[ $? -gt 1 ]] ;then | 129 | if [[ $? -gt 1 ]] ;then |
130 | echo " Run curl failed" | 130 | echo " Run curl failed" |
131 | if [ "${OS}" == 'CentOS' ]; then | 131 | if [ "${OS}" == 'CentOS' ]; then |
@@ -140,7 +140,7 @@ function check_curl(){ | @@ -140,7 +140,7 @@ function check_curl(){ | ||
140 | echo $result | 140 | echo $result |
141 | } | 141 | } |
142 | function check_md5sum(){ | 142 | function check_md5sum(){ |
143 | - md5sum --version >/dev/null | 143 | + md5sum --version >/dev/null 2>&1 |
144 | if [[ $? -gt 6 ]] ;then | 144 | if [[ $? -gt 6 ]] ;then |
145 | echo " Run md5sum failed" | 145 | echo " Run md5sum failed" |
146 | fi | 146 | fi |
@@ -241,14 +241,14 @@ function fun_download_file(){ | @@ -241,14 +241,14 @@ function fun_download_file(){ | ||
241 | fi | 241 | fi |
242 | fi | 242 | fi |
243 | fi | 243 | fi |
244 | - check_curl | ||
245 | - check_md5sum | ||
246 | - md5_web=`curl -s ${program_download_url}${md5sum_file} | sed -n "/${program_file}/p" | awk '{print $1}'` | ||
247 | - local_md5=`md5sum ${str_ngrok_dir}/bin/ngrokd | awk '{print $1}'` | ||
248 | - if [ "${local_md5}" != "${md5_web}" ]; then | ||
249 | - echo "md5sum not match,Failed to download ${program_file} file!" | ||
250 | - exit 1 | ||
251 | - fi | 244 | + #check_curl |
245 | + #check_md5sum | ||
246 | + #md5_web=`curl -s ${program_download_url}${md5sum_file} | sed -n "/${program_file}/p" | awk '{print $1}'` | ||
247 | + #local_md5=`md5sum ${str_ngrok_dir}/bin/ngrokd | awk '{print $1}'` | ||
248 | + #if [ "${local_md5}" != "${md5_web}" ]; then | ||
249 | + # echo "md5sum not match,Failed to download ${program_file} file!" | ||
250 | + # exit 1 | ||
251 | + #fi | ||
252 | [ ! -x ${str_ngrok_dir}/bin/ngrokd ] && chmod 755 ${str_ngrok_dir}/bin/ngrokd | 252 | [ ! -x ${str_ngrok_dir}/bin/ngrokd ] && chmod 755 ${str_ngrok_dir}/bin/ngrokd |
253 | } | 253 | } |
254 | function pre_install(){ | 254 | function pre_install(){ |
@@ -259,7 +259,7 @@ function pre_install(){ | @@ -259,7 +259,7 @@ function pre_install(){ | ||
259 | yum -y install nano net-tools openssl-devel curl curl-devel psmisc wget | 259 | yum -y install nano net-tools openssl-devel curl curl-devel psmisc wget |
260 | else | 260 | else |
261 | apt-get update -y | 261 | apt-get update -y |
262 | - apt-get install -y wget build-essential mercurial nano curl psmisc openssl libcurl4-openssl-dev | 262 | + apt-get install -y wget build-essential mercurial nano curl psmisc openssl libcurl4-openssl-dev net-tools |
263 | fi | 263 | fi |
264 | [ ! -d ${str_ngrok_dir}/bin/ ] && mkdir -p ${str_ngrok_dir}/bin/ | 264 | [ ! -d ${str_ngrok_dir}/bin/ ] && mkdir -p ${str_ngrok_dir}/bin/ |
265 | cd ${str_ngrok_dir} | 265 | cd ${str_ngrok_dir} |