Gateway switch script.