import double fix 4
This commit is contained in:
		
							
								
								
									
										45
									
								
								wire_g
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								wire_g
									
									
									
									
									
								
							@@ -91,34 +91,33 @@ import_wg(){
 | 
			
		||||
                        --borders=8 --undecorated \
 | 
			
		||||
                        --timeout-indicator=bottom --skip-taskbar
 | 
			
		||||
                        import_wg  
 | 
			
		||||
    else
 | 
			
		||||
            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
 | 
			
		||||
                    then
 | 
			
		||||
                        ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/  .*//')
 | 
			
		||||
                        if [[ -n $ACTIVE ]]
 | 
			
		||||
                            then  
 | 
			
		||||
                                wg_stop
 | 
			
		||||
                                nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
 | 
			
		||||
                                wait
 | 
			
		||||
                                wg_notify                                    
 | 
			
		||||
                        else
 | 
			
		||||
                                kill $lines
 | 
			
		||||
                                nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
 | 
			
		||||
                                wait
 | 
			
		||||
                                wg_notify 
 | 
			
		||||
                        fi                                
 | 
			
		||||
                  fi ;;
 | 
			
		||||
                    *_*.conf) if grep -i 'PEER\|PublicKey' $WG_CONF  > /dev/null &&  grep -i 'Interface\|PrivateKey' $WG_CONF > /dev/null
 | 
			
		||||
                                then
 | 
			
		||||
                                    ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/  .*//')
 | 
			
		||||
                                    if [[ -n $ACTIVE ]]
 | 
			
		||||
                                        then  
 | 
			
		||||
                                            wg_stop
 | 
			
		||||
                                            nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
 | 
			
		||||
                                            wait
 | 
			
		||||
                                            wg_notify                                    
 | 
			
		||||
                                    else
 | 
			
		||||
                                            kill $lines
 | 
			
		||||
                                            nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
 | 
			
		||||
                                            wait
 | 
			
		||||
                                            wg_notify 
 | 
			
		||||
                                    fi 
 | 
			
		||||
 | 
			
		||||
               *) yad --image-on-top --image=${WG_PIC}wg-info.png --height=150 --width=240 \
 | 
			
		||||
                      --text-align=center --undecorated --skip-taskbar \
 | 
			
		||||
                      --borders=12 --button="OK" --buttons-layout=center --center \
 | 
			
		||||
                      --text $"<b>Oh, something went wrong. No valid Wireguard file. </b> \n
 | 
			
		||||
                           *) yad --image-on-top --image=${WG_PIC}wg-info.png --height=150 --width=240 \
 | 
			
		||||
                                  --text-align=center --undecorated --skip-taskbar \
 | 
			
		||||
                                  --borders=12 --button="OK" --buttons-layout=center --center \
 | 
			
		||||
                                  --text $"<b>Oh, something went wrong. No valid Wireguard file. </b> \n
 | 
			
		||||
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span>"           
 | 
			
		||||
import_wg ;;
 | 
			
		||||
    esac 
 | 
			
		||||
                esac 
 | 
			
		||||
 | 
			
		||||
    fi }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user