mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	Testing for it in Python means that we have to worry about keeping the `upgrade-zulip-stage-2` backwards-compatible with all versions of Python which we could ever be upgrading from -- which is all of them. Factor out the "supported operating systems" check, and share it between upgrade and install codepaths.
		
			
				
	
	
		
			26 lines
		
	
	
		
			518 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			518 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| #
 | |
| # This script serves only to verify that the OS is a supported
 | |
| # version, before we attempt to rely on that version in
 | |
| # upgrade-zulip-stage-3
 | |
| 
 | |
| if [ -f /etc/os-release ]; then
 | |
|     os_info="$(
 | |
|         . /etc/os-release
 | |
|         printf '%s\n' "$ID" "$VERSION_ID"
 | |
|     )"
 | |
|     {
 | |
|         read -r os_id
 | |
|         read -r os_version_id
 | |
|     } <<<"$os_info"
 | |
| fi
 | |
| 
 | |
| case "$os_id $os_version_id" in
 | |
|     'debian 12' | 'ubuntu 22.04' | 'ubuntu 24.04')
 | |
|         exit 0
 | |
|         ;;
 | |
|     *)
 | |
|         exit 1
 | |
|         ;;
 | |
| esac
 |