test3 import ohne else
This commit is contained in:
		
							
								
								
									
										26
									
								
								wire_g
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								wire_g
									
									
									
									
									
								
							@@ -91,30 +91,22 @@ import_wg(){
 | 
			
		||||
                                nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                                wg_notify
 | 
			
		||||
 | 
			
		||||
                        elif [[ -z $active ]]
 | 
			
		||||
                            then
 | 
			
		||||
                        else
 | 
			
		||||
                                nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                                wg_notify
 | 
			
		||||
 | 
			
		||||
                        else 
 | 
			
		||||
                                yad --text-align=center --button=$"OK" --title=$"Wireguard .conf Select file" \
 | 
			
		||||
                                --image-on-top --image=${wg_pic}wg-info.png \
 | 
			
		||||
                                --fixed --center --buttons-layout=center --borders=8 \
 | 
			
		||||
                                --text $"<b>Oh, something went wrong.</b> \n
 | 
			
		||||
<b>No valid Wireguard file.</b> \n 
 | 
			
		||||
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span> \n"  
 | 
			
		||||
                    import_wg 
 | 
			
		||||
                        fi
 | 
			
		||||
                    fi ;;
 | 
			
		||||
 | 
			
		||||
                *)              yad --text-align=center --button=$"OK" --title=$"Wireguard .conf Select file" \
 | 
			
		||||
                                --image-on-top --image=${wg_pic}wg-info.png \
 | 
			
		||||
                                --fixed --center --buttons-layout=center --borders=8 \
 | 
			
		||||
                                --text $"<b>Oh, something went wrong.</b> \n
 | 
			
		||||
                *) yad --text-align=center --button=$"OK" --title=$"Wireguard .conf Select file" \
 | 
			
		||||
                       --image-on-top --image=${wg_pic}wg-info.png \
 | 
			
		||||
                       --fixed --center --buttons-layout=center --borders=8 \
 | 
			
		||||
                       --text $"<b>Oh, something went wrong.</b> \n
 | 
			
		||||
<b>No valid Wireguard file.</b> \n 
 | 
			
		||||
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span> \n" 
 | 
			
		||||
                    import_wg ;;
 | 
			
		||||
    esac }
 | 
			
		||||
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span> \n" ;;
 | 
			
		||||
    esac 
 | 
			
		||||
import_wg 
 | 
			
		||||
}
 | 
			
		||||
export -f import_wg
 | 
			
		||||
 | 
			
		||||
# function end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user