diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-07-26 20:40:54 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-07-26 20:40:54 -0400 |
| commit | f085b7de029c9a9b73a65e837cce72067bd858c3 (patch) | |
| tree | 8de0a44a8564e967363a974b6cd8fbd204daa7d4 /src | |
| parent | 136b4d74c7deeff52c3c27754b68a8e81ef20863 (diff) | |
propellor spin
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/JoeySites.hs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 499409e0..daf39805 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -930,18 +930,17 @@ alarmClock oncalendar (User user) command = combineProperties "goodmorning timer & "/etc/systemd/logind.conf" `ConfFile.containsIniSetting` ("Login", "LidSwitchIgnoreInhibited", "no") --- | Enable IP masqerading, from the intif to the extif. -ipmasq :: String -> String -> Property DebianLike -ipmasq extif intif = script `File.hasContent` +-- | Enable IP masqerading, on whatever other interfaces come up. +ipmasq :: String -> Property DebianLike +ipmasq intif = script `File.hasContent` [ "#!/bin/sh" - , "EXTIF=" ++ extif , "INTIF=" ++ intif - , "if [ \"$IFACE\" != $EXTIF; then" + , "if [ \"$IFACE\" = $INTIF ] || [ \"$IFACE\" = lo ]; then" , "exit 0" , "fi" - , "iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT" - , "iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT" - , "iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE" + , "iptables -A FORWARD -i $IFACE -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT" + , "iptables -A FORWARD -i $INTIF -o $IFACE -j ACCEPT" + , "iptables -t nat -A POSTROUTING -o $IFACE -j MASQUERADE" , "echo 1 > /proc/sys/net/ipv4/ip_forward" ] `requires` Apt.installed ["iptables"] |
