17 lines
428 B
Python
17 lines
428 B
Python
#!/usr/bin/env python3
|
|
"""Add IP 115.227.36.10 to nginx whitelist"""
|
|
|
|
with open('/opt/wecom-it-desk/nginx/nginx.conf', 'r') as f:
|
|
content = f.read()
|
|
|
|
# Add after existing office IPs
|
|
content = content.replace(
|
|
'allow 218.75.34.87;',
|
|
'allow 218.75.34.87;\n allow 115.227.36.10; # 新增办公网出口IP'
|
|
)
|
|
|
|
with open('/opt/wecom-it-desk/nginx/nginx.conf', 'w') as f:
|
|
f.write(content)
|
|
|
|
print('Done')
|