Merge pull request #8180 from zmstone/0611-chore-remove-unused-code
chore: remove unused code
This commit is contained in:
commit
9ef184bc21
9
bin/emqx
9
bin/emqx
|
@ -368,7 +368,9 @@ remsh() {
|
|||
-remsh "$NAME" -boot "$REL_DIR/start_clean" \
|
||||
-boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
|
||||
-boot_var RELEASE_LIB "$ERTS_LIB_DIR" \
|
||||
-setcookie "$COOKIE" -hidden -kernel net_ticktime "$TICKTIME" \
|
||||
-setcookie "$COOKIE" \
|
||||
-hidden \
|
||||
-kernel net_ticktime "$TICKTIME" \
|
||||
$EPMD_ARGS
|
||||
else
|
||||
set -- "$REL_DIR/iex" \
|
||||
|
@ -692,12 +694,13 @@ case "$NAME" in
|
|||
NAME_TYPE='-sname'
|
||||
esac
|
||||
SHORT_NAME="$(echo "$NAME" | awk -F'@' '{print $1}')"
|
||||
export ESCRIPT_NAME="$SHORT_NAME"
|
||||
|
||||
if ! (echo "$SHORT_NAME" | grep -q '^[0-9A-Za-z_\-]\+$'); then
|
||||
echo "Invalid node name, should be of format '^[0-9A-Za-z_-]+$'."
|
||||
exit 1
|
||||
fi
|
||||
# This also changes the program name from 'beam.smp' to node name
|
||||
# e.g. the 'ps' command output
|
||||
export ESCRIPT_NAME="$SHORT_NAME"
|
||||
|
||||
PIPE_DIR="${PIPE_DIR:-/$DATA_DIR/${WHOAMI}_erl_pipes/$NAME/}"
|
||||
|
||||
|
|
|
@ -17,11 +17,7 @@ shopt -s nullglob
|
|||
LOCAL_IP=$(hostname -i | grep -oE '((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])\.){3}(25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])' | head -n 1)
|
||||
|
||||
if [[ -z "$EMQX_NODE_NAME" ]]; then
|
||||
|
||||
if [[ -z "$EMQX_NAME" ]]; then
|
||||
EMQX_NAME='emqx'
|
||||
fi
|
||||
|
||||
EMQX_NAME="${EMQX_NAME:-emqx}"
|
||||
if [[ -z "$EMQX_HOST" ]]; then
|
||||
if [[ "$EMQX_CLUSTER__K8S__ADDRESS_TYPE" == "dns" ]] && [[ -n "$EMQX_CLUSTER__K8S__NAMESPACE" ]]; then
|
||||
EMQX_CLUSTER__K8S__SUFFIX=${EMQX_CLUSTER__K8S__SUFFIX:-"pod.cluster.local"}
|
||||
|
@ -38,25 +34,6 @@ if [[ -z "$EMQX_NODE_NAME" ]]; then
|
|||
unset EMQX_HOST
|
||||
fi
|
||||
|
||||
# fill tuples on specific file
|
||||
# SYNOPSIS
|
||||
# fill_tuples FILE [ELEMENTS ...]
|
||||
fill_tuples() {
|
||||
local file=$1
|
||||
local elements=${*:2}
|
||||
for var in $elements; do
|
||||
if grep -qE "\{\s*$var\s*,\s*(true|false)\s*\}\s*\." "$file"; then
|
||||
sed -r "s/\{\s*($var)\s*,\s*(true|false)\s*\}\s*\./{\1, true}./1" "$file" > tmpfile && cat tmpfile > "$file"
|
||||
elif grep -q "$var\s*\." "$file"; then
|
||||
# backward compatible.
|
||||
sed -r "s/($var)\s*\./{\1, true}./1" "$file" > tmpfile && cat tmpfile > "$file"
|
||||
else
|
||||
sed '$a'\\ "$file" > tmpfile && cat tmpfile > "$file"
|
||||
echo "{$var, true}." >> "$file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# The default rpc port discovery 'stateless' is mostly for clusters
|
||||
# having static node names. So it's troulbe-free for multiple emqx nodes
|
||||
# running on the same host.
|
||||
|
|
Loading…
Reference in New Issue