mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-10-31 17:25:06 +03:00 
			
		
		
		
	changed files and folders name
This commit is contained in:
		
							parent
							
								
									c8a6897144
								
							
						
					
					
						commit
						c32e5517f1
					
				
					 16 changed files with 0 additions and 0 deletions
				
			
		
							
								
								
									
										77
									
								
								contrib/busybox-init/S42mesh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										77
									
								
								contrib/busybox-init/S42mesh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,77 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| CONFFILE="/etc/mesh.conf" | ||||
| 
 | ||||
| genconf() { | ||||
| 	/usr/bin/mesh -genconf > "$1" | ||||
| 	return $? | ||||
| } | ||||
| 
 | ||||
| probetun() { | ||||
| 	modprobe tun | ||||
| 	return $? | ||||
| } | ||||
| 
 | ||||
| start() { | ||||
| 	if [ ! -f "$CONFFILE" ]; then | ||||
| 		printf 'Generating configuration file: ' | ||||
| 		if genconf "$CONFFILE"; then | ||||
| 			echo "OK" | ||||
| 		else | ||||
| 			echo "FAIL" | ||||
| 			return 1 | ||||
| 		fi | ||||
| 	fi | ||||
| 
 | ||||
| 	if [ ! -e /dev/net/tun ]; then | ||||
| 		printf 'Inserting TUN module: ' | ||||
| 		if probetun; then | ||||
| 			echo "OK" | ||||
| 		else | ||||
| 			echo "FAIL" | ||||
| 			return 1 | ||||
| 		fi | ||||
| 	fi | ||||
| 
 | ||||
| 	printf 'Starting mesh: ' | ||||
| 	if start-stop-daemon -S -q -b -x /usr/bin/mesh \ | ||||
| 		-- -useconffile "$CONFFILE"; then | ||||
| 		echo "OK" | ||||
| 	else | ||||
| 		echo "FAIL" | ||||
| 	fi | ||||
| } | ||||
| 
 | ||||
| stop() { | ||||
| 	printf "Stopping mesh: " | ||||
| 	if start-stop-daemon -K -q -x /usr/bin/mesh; then | ||||
| 		echo "OK" | ||||
| 	else | ||||
| 		echo "FAIL" | ||||
| 	fi | ||||
| } | ||||
| 
 | ||||
| reload() { | ||||
| 	printf "Reloading mesh: " | ||||
| 	if start-stop-daemon -K -q -s HUP -x /usr/bin/mesh; then | ||||
| 		echo "OK" | ||||
| 	else | ||||
| 		echo "FAIL" | ||||
| 		start | ||||
| 	fi | ||||
| } | ||||
| 
 | ||||
| restart() { | ||||
| 	stop | ||||
| 	start | ||||
| } | ||||
| 
 | ||||
| case "$1" in | ||||
| 	start|stop|restart|reload) | ||||
| 		"$1";; | ||||
| 	*) | ||||
| 		echo "Usage: $0 {start|stop|restart|reload}" | ||||
| 		exit 1 | ||||
| esac | ||||
| 
 | ||||
| exit 0 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 vadym
						vadym