1 2 3 4 5 6
#!/bin/bash if systemctl is-active --quiet xray; then systemctl stop xray else systemctl start xray fi