Skip to content

Commit

Permalink
Quote variables to better support spaces, etc. (#713)
Browse files Browse the repository at this point in the history
Double quote to prevent globbing and word splitting
  • Loading branch information
leeomara authored and ikreymer committed Aug 8, 2019
1 parent 1302961 commit 051eda1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions init-default.sh
Expand Up @@ -10,17 +10,17 @@ if [ -e "$target" ]; then
exit 1
fi

cp $sample $target
cp "$sample" "$target"

function set_key {
key=$(python -c "import os; import base64; print(base64.b32encode(os.urandom(75)))")
sed -i'' -e "s/$1=.*/$1=$key/g" $target
sed -i'' -e "s/$1=.*/$1=$key/g" "$target"
}

set_key "SECRET_KEY"
set_key "ENCRYPT_KEY"
set_key "VALIDATE_KEY"

mkdir $CURR_DIR/data
mkdir $CURR_DIR/data/warcs/
mkdir "$CURR_DIR/data"
mkdir "$CURR_DIR/data/warcs/"

0 comments on commit 051eda1

Please sign in to comment.