Created
August 13, 2017 17:01
-
-
Save misodengaku/7473a2420866e8b487830e8f83cf57f7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 json, sys | |
| import argparse | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("name") | |
| parser.add_argument("value") | |
| args = parser.parse_args() | |
| dns = json.load(sys.stdin, encoding='utf-8') | |
| for i, record in enumerate(dns["CommonServiceItem"]["Settings"]["DNS"]["ResourceRecordSets"]): | |
| if record["Name"] == args.name: | |
| dns["CommonServiceItem"]["Settings"]["DNS"]["ResourceRecordSets"][i]["RData"] = args.value | |
| print(json.dumps(dns, indent=4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment