feat: minimal bk support#77
Conversation
update update * refactor(create_swap.sh): remove vm.swappiness and vm.vfs_cache_pressure system configurations from script
| if [ -f "$SWAP_PATH" ]; then | ||
| swapoff -v "$SWAP_PATH" | ||
| rm -f "$SWAP_PATH" | ||
| sed -i.$(date +%F) "\@$SWAP_PATH@d" /etc/fstab |
Check warning
Code scanning / shellcheck
Quote this to prevent word splitting.
| -p | --port ) | ||
| shift | ||
| PORT=$1 | ||
| PORTS=( $1 ) |
Check warning
Code scanning / shellcheck
Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
| if ! [[ "$PORT" =~ [0-9]+ ]]; then # 其实要判断是否在1<port<65545之间 | ||
| warning "redis_cluster 的端口不是字符串" | ||
|
|
||
| if [[ -z ${PORTS[@]} ]];then |
Check failure
Code scanning / shellcheck
Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).
| if [[ $(ss -tnl4 | awk -v addr="^${BIND_ADDR}:${PORT}$" '$4 ~ addr' | wc -l) -ge 1 ]]; then | ||
| warning "${BIND_ADDR}:${PORT} 已经监听,请确认" | ||
| fi | ||
| for port in ${PORTS[@]}; do |
Check failure
Code scanning / shellcheck
Double quote array expansions to avoid re-splitting elements.
| CONF_NAME=${NAME}.conf | ||
| log "生成 /etc/redis/$CONF_NAME 配置文件" | ||
| cat > /etc/redis/"${CONF_NAME}" <<EOF | ||
| for port in ${PORTS[@]}; do |
Check failure
Code scanning / shellcheck
Double quote array expansions to avoid re-splitting elements.
| local module=log | ||
| local target_name=$(map_module_name $module) | ||
| source <(/opt/py36/bin/python ${SELF_DIR}/qq.py -p ${BK_PKG_SRC_PATH}/${target_name}/projects.yaml -P ${SELF_DIR}/bin/default/port.yaml) | ||
| projects=${_projects[${module}]} |
Check warning
Code scanning / shellcheck
Variable was used as an array but is now assigned a string.
|
|
||
| for project in ${projects[@]}; do | ||
| IFS="," read -r -a target_server<<<${_project_ip["${target_name},${project}"]} | ||
| for ip in ${target_server[@]}; do |
Check failure
Code scanning / shellcheck
Double quote array expansions to avoid re-splitting elements.
|
|
||
| case $module in | ||
| paas|license|cmdb|job|gse|yum|consul|pypi|bkenv|rabbitmq|zk|mongodb|influxdb|license|cert|nginx|usermgr|appo|bklog|es7|python|appt|kafka|beanstalk|fta|dbcheck|controller|lesscode|node|bkapi|apigw|etcd|apisix|redis_cluster) | ||
| install_"${module}" $@ |
Check failure
Code scanning / shellcheck
Double quote array expansions to avoid re-splitting elements.
|
|
||
| sed -i '/gunicorn/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/fta/support-files/templates/#etc#supervisor-fta-fta.conf | ||
| sed -i '/gunicorn wsgi/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/usermgr/support-files/templates/#etc#supervisor-usermgr-api.conf | ||
| for m in ${module[@]}; do |
Check failure
Code scanning / shellcheck
Double quote array expansions to avoid re-splitting elements.
| sed -i '/gunicorn/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/fta/support-files/templates/#etc#supervisor-fta-fta.conf | ||
| sed -i '/gunicorn wsgi/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/usermgr/support-files/templates/#etc#supervisor-usermgr-api.conf | ||
| for m in ${module[@]}; do | ||
| tweak_$m |
Check notice
Code scanning / shellcheck
Double quote to prevent globbing and word splitting.
No description provided.