| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/bash
- # 注意:不同shell对语法的支持有细微差别,第一行并不能随便写。
- cd /app
- # 自动更新当前架构可用版本
- bash auto_update.bash
- # 首次启动时配置文件不存在,自动生成
- EDGE_FILE='/app/config/edge.conf'
- SUPER_FILE='/app/config/supernode.conf'
- if [ ! -f $SUPER_FILE ]; then
- echo "#####Generating supernode configuration file#####"
- cat>"${SUPER_FILE}"<<EOF
- # The configuration file is similar to the command line, with one option per line. An equal
- # sign '=' should be used between key and value. Example: -p=7777
- # This file contains a basic configuration example, please refer to the help (-h) for the full
- # list of available options.
- #
- # -p
- # Sets the UDP listening port.
- #
- -p=7777
- #
- # -c
- # Optionally specifies the allowed communities as listed in community.list file.
- #
- # -c=community.list
- -a=172.30.0.0-172.30.0.0/16
- EOF
- else
- echo "##### supernode Configuration file already exists#####"
- fi
- if [ ! -f $EDGE_FILE ]; then
- echo "#####Generating edge configuration file#####"
- cat>"${EDGE_FILE}"<<EOF
- -c=mynetwork
- -k=mysecretpass
- -a=172.30.0.111/16
- -l=supernode.ntop.org:7777
- -A5
- -S2
- #-H
- EOF
- else
- echo "##### edge Configuration file already exists#####"
- fi
- if [[ ${START_TYPE} == "supernode" ]]; then
- /app/bin/supernode $SUPER_FILE -f
- else
- /app/bin/edge $EDGE_FILE -f
- fi
- exec "$@"
|