Skip to content

Instantly share code, notes, and snippets.

@tafaust
Created June 23, 2017 08:55
Show Gist options
  • Save tafaust/ec34f3f9a412efa54dd368e476eff238 to your computer and use it in GitHub Desktop.
Save tafaust/ec34f3f9a412efa54dd368e476eff238 to your computer and use it in GitHub Desktop.
Shell script to terminate all services started by DC/OS that run on the master node. Source: https://dcos.io/docs/1.9/installing/ports/
#!/usr/bin/bash
killall nginx 2>/dev/null && echo "Killing nginx service on ports 80, 443"
for port in {53,1050,1801,2181,5050,7070,8080,8123,8181,9990,15055,15101,15201}; do
kill -9 $(netstat -tlnp | awk "/:$port */ {split(\$NF,a,\"/\"); print a[1]}") 2>/dev/null && echo "Killing service that runs on port $port"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment