mirror of
https://git.photon.obnh.io/AXSY/whois.git
synced 2025-12-11 04:39:15 +00:00
fix: Remove incorrect AS 60284 entry and add remove-as utility
- Removed AS 60284 which was accidentally added instead of 76-2:0:17 - Added remove-as script for programmatically removing AS entries - Updated AS 2:0:17 with correct ISD 76 information 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
10
db/as/2:0:17
10
db/as/2:0:17
@@ -1,10 +1,12 @@
|
||||
% SCION AS WHOIS Information
|
||||
|
||||
AS Identifier: 2:0:17
|
||||
ISD: 64
|
||||
ISD: 76
|
||||
AS decimal:
|
||||
Organization: Axpo WZ-Systems AG
|
||||
Organization: Axpo Systems AG
|
||||
Country: CH
|
||||
UID: CHE-107.410.894
|
||||
Status: ASSIGNED
|
||||
Contact: noc@axpo-wz-systems-ag.com
|
||||
DateAllocated: 2025-05-13
|
||||
Description: Axpo Systems AG 76-2:0:17 Services
|
||||
Contact: noc@axpo-systems.com
|
||||
DateAllocated: 2025-06-26
|
||||
|
||||
12
db/as/60284
12
db/as/60284
@@ -1,12 +0,0 @@
|
||||
% SCION AS WHOIS Information
|
||||
|
||||
AS Identifier: 60284
|
||||
ISD: 76
|
||||
AS decimal: 60284
|
||||
Organization: Axpo Systems AG
|
||||
Country: CH
|
||||
UID: CHE-107.410.894
|
||||
Status: ASSIGNED
|
||||
Description: Axpo Systems AG 76-60284 Services
|
||||
Contact: noc@axpo-systems.com
|
||||
DateAllocated: 2025-06-26
|
||||
74
remove-as
Executable file
74
remove-as
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
def remove_as_entry(as_id, dry_run=False):
|
||||
"""Remove an AS entry from the WHOIS database"""
|
||||
# Get the database path
|
||||
script_dir = Path(__file__).parent
|
||||
db_dir = script_dir / 'db' / 'as'
|
||||
|
||||
# Construct the file path
|
||||
as_file = db_dir / as_id
|
||||
|
||||
# Check if the file exists
|
||||
if not as_file.exists():
|
||||
print(f"Error: AS entry '{as_id}' not found in database")
|
||||
return False
|
||||
|
||||
# Read and display the entry before deletion
|
||||
print(f"\nAS entry to be removed:")
|
||||
print("-" * 50)
|
||||
with open(as_file, 'r') as f:
|
||||
print(f.read())
|
||||
print("-" * 50)
|
||||
|
||||
if dry_run:
|
||||
print("\n[DRY RUN] Would remove:", as_file)
|
||||
return True
|
||||
|
||||
# Confirm deletion
|
||||
response = input(f"\nAre you sure you want to remove AS {as_id}? (yes/no): ")
|
||||
if response.lower() != 'yes':
|
||||
print("Deletion cancelled")
|
||||
return False
|
||||
|
||||
# Remove the file
|
||||
try:
|
||||
os.remove(as_file)
|
||||
print(f"\nSuccessfully removed AS entry: {as_id}")
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Error removing AS entry: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Remove an AS entry from the WHOIS database',
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
epilog="""
|
||||
Examples:
|
||||
./remove-as 60284 # Remove AS 60284
|
||||
./remove-as 76-60284 # Remove AS 76-60284
|
||||
./remove-as 2:0:17 # Remove AS 2:0:17
|
||||
./remove-as --dry-run 60284 # Show what would be removed without deleting
|
||||
"""
|
||||
)
|
||||
|
||||
parser.add_argument('as_id', help='AS identifier to remove (e.g., 60284, 76-60284, 2:0:17)')
|
||||
parser.add_argument('--dry-run', action='store_true',
|
||||
help='Show what would be removed without actually deleting')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Remove the AS entry
|
||||
success = remove_as_entry(args.as_id, args.dry_run)
|
||||
|
||||
# Exit with appropriate code
|
||||
sys.exit(0 if success else 1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user