先去下载 https://natapp.cn/#download linux 64位,放到 /usr/local
在/etc/systemd/system目录下新建 natapp.service
vi natapp.service
# Centos 7
# 存放位置 /usr/lib/systemd/system
# 开启 systemctl start natapp
# 关闭 systemctl stop natapp
# 开机启动 systemctl enable natapp
# 取消开机启动 system disable natapp[Unit]
Description=NatApp Service
Wants=network-online.target
After=network.target[Service]
Type=simple
ExecStart=/usr/local/natapp/natapp -authtoken=xxxxxx -log=stdout
# Suppress stderr to eliminate duplicated messages in syslog. NM calls openlog()
# with LOG_PERROR when run in foreground. But systemd redirects stderr to
# syslog by default, which results in logging each message twice.
StandardOutput=syslog
StandardError=null[Install]
WantedBy=multi-user.target
设置权限:
chmod +777 natapp.service
设置开机启动:
systemctl enable natapp.service
立即启动:
systemctl start natapp.service
来源地址:natapp内网穿透服务在linux centos7开机自启动脚本
转载声明:本站文章若无特别说明,皆为原创,转载请注明来源:www.88531.cn资享网,谢谢!^^