diff --git a/tools/gen_auth_tokens.sh b/tools/gen_auth_tokens.sh index 344a92e3..4fdbaa79 100755 --- a/tools/gen_auth_tokens.sh +++ b/tools/gen_auth_tokens.sh @@ -27,16 +27,14 @@ generate_token() { } write_token() { - local auth_level="$1" $(echo "$1" | tr '[:lower:]' '[:upper:]') + local auth_level="$1" local token="$2" local auth_level=$(echo "$auth_level" | tr '[:lower:]' '[:upper:]') local var_name="CELESTIA_NODE_AUTH_TOKEN_${auth_level}" - sed -i '.bak' -e "s/.*$var_name.*/$var_name=$token/" "$DOTENV" - rm "$DOTENV.bak" # there's no compatible way to tell sed not to do a backup file - # accept it and remove the file afterwards + ex "+%s/.*$var_name.*/$var_name=$token/" -scwq "$DOTENV" } main() {