This commit is contained in:
qiaofeng1227 2023-09-23 11:14:00 +08:00
parent 83c6e37a48
commit 6ef55aeb83

View file

@ -6,6 +6,7 @@ trap "sleep 1; continue" ERR
try_times=30 try_times=30
counter=1 counter=1
portainer_username="admin"
copy_credential() { copy_credential() {
source_container=$1 source_container=$1
@ -26,7 +27,7 @@ copy_credential() {
else else
# If it is not JSON format, get the content and convert it to JSON # If it is not JSON format, get the content and convert it to JSON
content=$(cat "$temp_file") content=$(cat "$temp_file")
json="{\"username\":\"$username\",\"password\":\"$content\"}" json="{\"username\":\"$portainer_username\",\"password\":\"$content\"}"
echo "$json" > "$temp_file" echo "$json" > "$temp_file"
docker cp "$temp_file" "$destination_container:$destination_path" docker cp "$temp_file" "$destination_container:$destination_path"
fi fi