diff --git a/ddos-mitigator/superscript.sh b/ddos-mitigator/superscript.sh index 5b3fac3..7fda27e 100755 --- a/ddos-mitigator/superscript.sh +++ b/ddos-mitigator/superscript.sh @@ -47,8 +47,42 @@ blue="\033[38;2;0;85;255m" bold="\033[1m" reset="\033[0m" +# Clean up when the script exits. +trap 'sudo -k; popd >/dev/null; rm -r ${tmpdir}' EXIT + +# Create a temp directory, chdir into it and create the (initially empty) +# banlist file. +tmpdir=$(mktemp -d) +# Suppress output of dir stack. +pushd "${tmpdir}" > /dev/null +touch "${banlist}" + function printHelp() { - echo "Help ... to be written." + cat < /dev/null -touch "${banlist}" - # Parse the command line options autopilot=0 netmask=0