Skip to content

Commit

Permalink
Feat: make new, tmp directory when not exist #45
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Jun 26, 2024
1 parent 860e33d commit 5237314
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/42cluster/create_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ if [ -z "${service_name}" ]; then
exit 1
fi

mkdir -p tmp
mkdir -p new

generate_hash() {
curr_time=$(date +%s)
temp_file="${curr_time}.tmp"
echo ${curr_time} > "${temp_file}"
hash=$(md5sum "$temp_file" | cut -d ' ' -f1)
rm "${temp_file}"
echo "${hash:0:32}"
echo "m${hash:0:31}"
}

create_json() {
Expand Down
3 changes: 3 additions & 0 deletions scripts/42cluster/remove_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ if [ -z "${service_name}" ]; then
exit 1
fi

mkdir -p tmp
mkdir -p new

source "$SECRET_PATH"
basic_token=$(echo -n "$ADMIN_ID:$ADMIN_PW" | base64)
urlencode=$(echo -n "${service_name}" | jq -sRr @uri)
Expand Down
3 changes: 3 additions & 0 deletions scripts/42cluster/update_service_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ if [ -z "${service_name}" ]; then
exit 1
fi

mkdir -p tmp
mkdir -p new

source "$SECRET_PATH"
basic_token=$(echo -n "$ADMIN_ID:$ADMIN_PW" | base64)

Expand Down

0 comments on commit 5237314

Please sign in to comment.