interfaceSubnet iface = do out <- spawnShell $ printf "ip addr show %s | grep inet" iface
                           case (out `matchG` "([0-9]+\\.[0-9]+\\.[0-9]+)\\.[0-9]+") of
                                [prefix] -> return $ prefix ++ ".0"
                                _ -> return ""
interfaceSubnet iface = do out <- spawnShell $ printf "ip addr show %s | grep inet" iface
                           case (out `matchG` "([0-9]+\\.[0-9]+\\.[0-9]+)\\.[0-9]+") of
                                [prefix] -> return $ prefix ++ ".0"
                                _ -> return ""
interfaceSubnet iface = do out <- spawnShell $ printf "ip addr show %s | grep inet" iface
                           case (out `matchG` "([0-9]+\\.[0-9]+\\.[0-9]+)\\.[0-9]+") of
                                [prefix] -> return $ prefix ++ ".0"
                                _ -> return ""