Add subcommands
							parent
							
								
									77ebb9b9b9
								
							
						
					
					
						commit
						282ade689c
					
				| 
						 | 
					@ -1,5 +1,23 @@
 | 
				
			||||||
#!/usr/bin/env bash
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
adb kill-server
 | 
					function start() {
 | 
				
			||||||
  adb start-server
 | 
					  adb start-server
 | 
				
			||||||
gnirehtet autorun
 | 
					  nohup gnirehtet autorun &> /dev/null &
 | 
				
			||||||
 | 
					  echo "Started reverse tethering"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function stop() {
 | 
				
			||||||
 | 
					  adb kill-server 
 | 
				
			||||||
 | 
					  gnirehtet stop
 | 
				
			||||||
 | 
					  pkill gnirehtet
 | 
				
			||||||
 | 
					  echo "Stopped reverse tethering"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					case "$1" in 
 | 
				
			||||||
 | 
					  start) start ;;
 | 
				
			||||||
 | 
					  stop) stop ;;
 | 
				
			||||||
 | 
					  restart) stop; start ;;
 | 
				
			||||||
 | 
					  *) echo "start | stop | restart" >&2
 | 
				
			||||||
 | 
					  exit 1
 | 
				
			||||||
 | 
					  ;;
 | 
				
			||||||
 | 
					esac
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue