test mit import doppelter tunnel
This commit is contained in:
		
							
								
								
									
										16
									
								
								wire_g
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								wire_g
									
									
									
									
									
								
							@@ -81,8 +81,20 @@ import_wg(){
 | 
				
			|||||||
                     --width=1200 --height=800 --no-klick \
 | 
					                     --width=1200 --height=800 --no-klick \
 | 
				
			||||||
                     --window-icon=${WG_PIC}wg-import.png \
 | 
					                     --window-icon=${WG_PIC}wg-import.png \
 | 
				
			||||||
                     --title=$"Wireguard .conf Select file")
 | 
					                     --title=$"Wireguard .conf Select file")
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
        then
 | 
					        then
 | 
				
			||||||
 | 
					            IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) ) 
 | 
				
			||||||
 | 
					            #echo ${lines[0]} #Damit wird der Inhalt ausgelesen. (Index angeben)
 | 
				
			||||||
 | 
					            for WG_CONF in "${lines[@]}"
 | 
				
			||||||
 | 
					                do 
 | 
				
			||||||
 | 
					                    yad --image-on-top --image=${WG_PIC}wg-info.png \
 | 
				
			||||||
 | 
					                        --text=$"Tunnel already exists!" \
 | 
				
			||||||
 | 
					                        --text-align=center --no-buttons \
 | 
				
			||||||
 | 
					                        --borders=8 --undecorated \
 | 
				
			||||||
 | 
					                        --timeout 3 --timeout-indicator=bottom --skip-taskbar
 | 
				
			||||||
 | 
					                        import_wg
 | 
				
			||||||
 | 
					                done 
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
            case "$WG_CONF" in
 | 
					            case "$WG_CONF" in
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                *_*.conf) if grep -i 'PEER\|PublicKey' $WG_CONF  > /dev/null &&  grep -i 'Interface\|PrivateKey' $WG_CONF > /dev/null
 | 
					                *_*.conf) if grep -i 'PEER\|PublicKey' $WG_CONF  > /dev/null &&  grep -i 'Interface\|PrivateKey' $WG_CONF > /dev/null
 | 
				
			||||||
@@ -149,8 +161,6 @@ remove(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
up_or_down(){
 | 
					up_or_down(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    WG_PIC="/home/$USER/.icons/"
 | 
					 | 
				
			||||||
    ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/  .*//')
 | 
					 | 
				
			||||||
    if [[ -z $ACTIVE ]]
 | 
					    if [[ -z $ACTIVE ]]
 | 
				
			||||||
        then
 | 
					        then
 | 
				
			||||||
            yad --image-on-top --image=${WG_PIC}wg-info.png \
 | 
					            yad --image-on-top --image=${WG_PIC}wg-info.png \
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user