Skip to content

Commit

Permalink
Ed is the standard text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0rek committed Sep 15, 2023
1 parent b81746f commit b6e096e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/gen_auth_tokens.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b6e096e

Please sign in to comment.