myaliyun ECS 启动内外穿透工具shell脚本

#!/bin/bash

tbp=/usr/local/ngrok

cmd=$1


if [[ -z $cmd ]];then
        echo "err!usage{sh $0 1|0 to start or shutdown the ngrok.}"
elif [[ $cmd -eq 1 ]];then
        nohup $tbp/bin/ngrokd -tlsKey=$tbp/server.key -tlsCrt=$tbp/server.crt -domain="ykmimi.com" -httpAddr=":80" -httpsAddr=":443" > listen.log 2>&1 &
        echo 'Start Success!~~~'
        # $tbp/bin/ngrokd -domain="ykmimi.com" -httpAddr=":80" -httpsAddr=":443"
elif [[ $cmd -eq 0 ]];then
        echo "todo shutdown"
else
       echo "err!just 1 or 0 behind $0,like(sh $0 1)"
fi

 

posted @ 2019-06-28 10:13  ukyo--BlackJesus  阅读(249)  评论(0编辑  收藏  举报