19 lines
		
	
	
		
			379 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			379 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
function devenv() {
 | 
						|
 | 
						|
  local status
 | 
						|
 | 
						|
  # Get LXC container status
 | 
						|
  status=$(lxc info devenv | yq .Status)
 | 
						|
 | 
						|
  # Start container if not running
 | 
						|
  if [ "${status}" != "RUNNING" ]; then lxc start devenv; fi
 | 
						|
 | 
						|
  # Rename tmux window if inside tmux
 | 
						|
  if [ -n "$TMUX" ]; then tmux rename-window "devenv"; fi
 | 
						|
 | 
						|
  # Login as user xavier
 | 
						|
  lxc exec devenv -- login -f xavier
 | 
						|
}
 |