root@ubuntu etc# cat frpc.ini 
[common]
server_addr = www.***.top
server_port = 655***

######## SSH ####################
[office ubuntu ssh]
type = tcp
local_ip = 172.16.66.***
local_port = 22
remote_port = 601***

[office nuc ssh]
type = tcp
local_ip = 172.16.66.***
local_port = 22
remote_port = 601***

######## mstsc #######################
[office acer_win7 mstsc]
type = tcp
local_ip = 172.16.66.***
local_port = 3389
remote_port = 601***

[office hp_win7 mstsc]
type = tcp
local_ip = 172.16.66.***
local_port = 3389
remote_port = 601***

######## SVN ########################
[office old SVN]
type = tcp
local_ip = 172.16.12.2***
local_port = 80
remote_port = 600***

[office nuc svn]
type = tcp
local_ip = 172.16.66.***
local_port = 3960
remote_port = 600***

######## SAMBA ##################
[office samba]
type = tcp
local_ip = 172.16.12.2***
local_port = 445
remote_port = 601***

root@ubuntu etc# 

==============================
root@ubuntu etc# cat frp.start.sh 

cmd='/etc/frpc -c /etc/frpc.ini'
app='frpc'

while true
do
    ps -ef > /tmp/frp.log
    grep frpc /tmp/frp.log
    if [ $? -eq 0 ]
    then
        echo "$cmd already runing ..."
        break
    else
        $cmd &
        echo "$cmd start runing ..."
        sleep 5
    fi
done
root@ubuntu etc# 

===============================
root@ubuntu etc# cat frp.restart.sh 

cmd='/etc/frpc -c /etc/frpc.ini'
app='frpc'

#KILL
while true
do
    ps -ef > /tmp/frp.log
    grep frpc /tmp/frp.log
    if [ $? -eq 0 ]
    then
        killall $app
        echo "killall $cmd ..."
        sleep 2
    else
        echo "killall $cmd clean..."
        break
    fi
done

#start
while true
do
    ps -ef > /tmp/frp.log
    grep frpc /tmp/frp.log
    if [ $? -eq 0 ]
    then
        echo "$cmd already runing ..."
        break
    else
        $cmd &
        echo "$cmd start runing ..."
        sleep 5
    fi
done

root@ubuntu etc# 
=====================================

root@ubuntu etc# 
root@ubuntu etc# cat /etc/crontab 
* * * * * root /etc/frp.start.sh
root@ubuntu etc#