Pipe switch