Check for network before running update scripts

Also fixes a bug where terminals opened with custom cwds would
sometimes be opened with the home directory instead.