Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
  • Loading branch information
quangnhnhut123 committed Dec 6, 2024
1 parent 732ddea commit 207c2e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions check-connections.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ check_s3_permissions() {
else
list_result=$(tput setaf 1)"No"$(tput sgr0) # Red color for No
fi
printf "%-30s %-10s\n" "List objects" "$list_result"
printf "%-20s %-10s\n" "List objects" "$list_result"

# Check if the user has permission to put objects
if echo "test" | aws s3 cp - "s3://$bucket_name/test-file" >/dev/null 2>&1; then
Expand All @@ -36,15 +36,15 @@ check_s3_permissions() {
else
put_result=$(tput setaf 1)"No"$(tput sgr0) # Red color for No
fi
printf "%-30s %-10s\n" "Put objects" "$put_result"
printf "%-20s %-10s\n" "Put objects" "$put_result"

# Check if the user has permission to delete objects
if aws s3 rm "s3://$bucket_name/non-existent-file" >/dev/null 2>&1; then
delete_result=$(tput setaf 2)"Yes"$(tput sgr0) # Green color for Yes
else
delete_result=$(tput setaf 1)"No"$(tput sgr0) # Red color for No
fi
printf "%-30s %-10s\n" "Delete objects" "$delete_result"
printf "%-20s %-10s\n" "Delete objects" "$delete_result"

print_separator
}
Expand Down

0 comments on commit 207c2e7

Please sign in to comment.