-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssl-check.py
More file actions
executable file
·29 lines (23 loc) · 1.2 KB
/
Copy pathssl-check.py
File metadata and controls
executable file
·29 lines (23 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
import sys
from subprocess import call
"""
ssl.py
This script will log into a pod and check all of the .conf files in /nas/wp/conf/lb/sites/ folder to see if anyone has a dedicated IP configured.
"""
sshname = "yourusername" # replace with your login
if __name__ == "__main__":
# Check for parameters: first parameter should be a pod/cluster; subsequent parameters should be a list of installs
args = sys.argv
if len(args) != 2:
print "Usage: ssl [pod]"
sys.exit(2)
execstr = "ssh %s@pod-%s.wpengine.com \"cd /nas/local/ssl; ls\"" % (sshname, args[1])
print "\nList of installs with SSL certificates on the server:\n"
call(execstr, shell=True)
execstr = "ssh %s@pod-%s.wpengine.com \"cd /nas/wp/conf/lb/sites; grep :443 *.conf\"" % (sshname, args[1])
print "\nList of sites that have a dedicated IP - check this against your migration list:\n"
call(execstr, shell=True)
redirectstr = "ssh %s@pod-%s.wpengine.com \"cd /nas/wp/conf/lb/sites; grep -A 5 \'Redirect insecure\' *.conf\"" % (sshname, args[1])
print "\nList of sites that have forced paths to HTTPS - check this against your migration list:\n"
call(redirectstr, shell=True)