Last active
June 23, 2019 08:35
-
-
Save techman83/0604f4dc9f849aac605e46f494de9403 to your computer and use it in GitHub Desktop.
Minimal Python3 script to Submit a Netkan file to an Inbound Queue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import sys | |
from hashlib import md5 | |
filename = sys.argv[1] | |
if not filename: | |
print('/path/to/Mod.netkan required') | |
sys.exit() | |
sqs = boto3.resource('sqs') | |
queue = sqs.get_queue_by_name(QueueName='InboundDev.fifo') | |
with open(filename, 'r') as netkan: | |
content = netkan.read() | |
queue.send_message(MessageBody=content, MessageGroupId='1', MessageDeduplicationId=md5(content.encode()).hexdigest()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment