17 lines
		
	
	
		
			282 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			282 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
bash stop.sh
 | 
						|
 | 
						|
for env in a b c; do
 | 
						|
 | 
						|
  # 启动screen
 | 
						|
  screen_name="screen_$env"  
 | 
						|
  screen -dmS $screen_name
 | 
						|
 | 
						|
  # 构造日志名
 | 
						|
  log="log_$env.log"
 | 
						|
 | 
						|
  # 使用go run 重定向日志
 | 
						|
  screen -S $screen_name -X stuff "go run main.go -etc $env >> $log 2>&1\n"  
 | 
						|
 | 
						|
done |