HeshamTB
1a611616bd
- Working basic wg controls - Working ip_pool allocation - Working basic HTTP API Signed-off-by: HeshamTB <hishaminv@gmail.com>
29 lines
489 B
Bash
Executable File
29 lines
489 B
Bash
Executable File
#!/bin/env bash
|
|
|
|
# A POSIX variable
|
|
OPTIND=1 # Reset in case getopts has been used previously in the shell.
|
|
|
|
# Initialize our own variables:
|
|
wg_interface=""
|
|
|
|
while getopts "h?i:" opt; do
|
|
case "$opt" in
|
|
h|\?)
|
|
#show_help
|
|
echo "Usage: isolate.sh -i <wg_interface>"
|
|
exit 0
|
|
;;
|
|
i) wg_interface=$OPTARG
|
|
;;
|
|
esac
|
|
done
|
|
|
|
shift $((OPTIND-1))
|
|
|
|
[ "${1:-}" = "--" ] && shift
|
|
|
|
|
|
set -x
|
|
iptables -I FORWARD -i $wg_interface -o $wg_interface -j DROP
|
|
set +x
|