This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NET=10.255.255.248 | |
MASK=255.255.255.248 | |
RULE="POSTROUTING -t nat -s $NET/$MASK -o eth0 -j MASQUERADE" | |
set -x | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
while true; do | |
eval iptables -D $RULE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't consider this snippet as helpful. Just some excersize with shell. | |
# Usually you do not need to remove a path from PATH because you are able not to add | |
# the the path to it. | |
# But once you want to move a path from the middle of PATH to head, so you should | |
# delete it first if you are kind of a perfectionist. :( | |
# HATE BASH! | |
# Remove element in joined array like PATH standard environment variable. | |
del-element() | |
{ |