neuer fix
This commit is contained in:
		
							
								
								
									
										30
									
								
								wire_g
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								wire_g
									
									
									
									
									
								
							@@ -44,7 +44,7 @@ wg_notify(){
 | 
			
		||||
    wg_pic="/home/$a_user/.icons/" 
 | 
			
		||||
    notify-send --icon=${wg_pic}wg-vpn.png $"$active powered"
 | 
			
		||||
    # autoconnect wird hier abgeschalten damit auch neu importierte nach einem Systemneustart nicht aktiv sind
 | 
			
		||||
    nmcli con mod "$active" connection.autoconnect no
 | 
			
		||||
    nmcli con mod $active connection.autoconnect no
 | 
			
		||||
    # ab hier beginnt yad notify
 | 
			
		||||
    #Pipe erstellen
 | 
			
		||||
    PIPE="$HOME/.pipe.tmp"
 | 
			
		||||
@@ -81,18 +81,18 @@ import_wg(){
 | 
			
		||||
 | 
			
		||||
    case "$wgconf" in
 | 
			
		||||
 | 
			
		||||
        *_*.conf) if grep -i 'PEER\|PublicKey' "$wgconf"  > /dev/null &&  grep -i 'Interface\|PrivateKey' "$wgconf" > /dev/null
 | 
			
		||||
        *_*.conf) if grep -i 'PEER\|PublicKey' $wgconf  > /dev/null &&  grep -i 'Interface\|PrivateKey' $wgconf > /dev/null
 | 
			
		||||
                    then  
 | 
			
		||||
                        active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/  .*//')
 | 
			
		||||
                        if [[ -n "$active" ]]
 | 
			
		||||
                        if [[ -n $active ]]
 | 
			
		||||
                            then  
 | 
			
		||||
                                wg_stop
 | 
			
		||||
                                nmcli connection import type wireguard file "$wgconf" &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                                nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                                wg_notify
 | 
			
		||||
 | 
			
		||||
                        elif [[ -z "$active" ]]
 | 
			
		||||
                        elif [[ -z $active ]]
 | 
			
		||||
                            then
 | 
			
		||||
                                nmcli connection import type wireguard file "$wgconf" &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                                nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                                wg_notify
 | 
			
		||||
 | 
			
		||||
                        else 
 | 
			
		||||
@@ -134,19 +134,19 @@ remove(){
 | 
			
		||||
                --fixed --buttons-layout=center --separator="" \
 | 
			
		||||
                --button=$"OK" --button=$"Cancel" \
 | 
			
		||||
                --borders=8 --image-on-top --image=${wg_pic}wg-active.png \
 | 
			
		||||
                --column=$"Delete" "$tunnel" \
 | 
			
		||||
                --column=$"Delete" $tunnel \
 | 
			
		||||
                --text=$"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$active</b></span> 
 | 
			
		||||
<b>----------------------------------------------------------------------------------</b>  
 | 
			
		||||
<b>If no tunnels are listed,</b> 
 | 
			
		||||
<b>so they have to import their tunnel beforehand.</b>")     
 | 
			
		||||
 | 
			
		||||
        then
 | 
			
		||||
            nmcli connection delete "$selection" &> ${wg_wdir}.tmp.txt 
 | 
			
		||||
            nmcli connection delete $selection &> ${wg_wdir}.tmp.txt 
 | 
			
		||||
            if success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt)
 | 
			
		||||
                then
 | 
			
		||||
                    yad --window-icon=${wg_pic}wg-trash.png \
 | 
			
		||||
                        --image-on-top --image=${wg_pic}wg-info.png \
 | 
			
		||||
                        --text=$"Your tunnel "$selection" was successfully deleted." \
 | 
			
		||||
                        --text=$"Your tunnel $selection was successfully deleted." \
 | 
			
		||||
                        --text-align=center --button=$"OK" --title "Wire-G Trash" \
 | 
			
		||||
                        --fixed --center --buttons-layout=center --borders=8 --center
 | 
			
		||||
            else 
 | 
			
		||||
@@ -205,7 +205,7 @@ more(){
 | 
			
		||||
                    --text=$"<span color='#626ff1'><b>Wire-G Author: Désiré Werner Menrath</b></span> \n 
 | 
			
		||||
<span color='#626ff1'><b>E-Mail: polunga40@unity-mail.de</b></span> \n
 | 
			
		||||
<span color='#626ff1'><b>At all tunnels, the auto start is disabled.</b></span> \n
 | 
			
		||||
<span color='#626ff1'><b>Version: "$version" </b></span> \n
 | 
			
		||||
<span color='#626ff1'><b>Version: $version </b></span> \n
 | 
			
		||||
<span color='#626ff1'><b>Use without warranty.</b></span> \n
 | 
			
		||||
<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \n")
 | 
			
		||||
 | 
			
		||||
@@ -221,7 +221,7 @@ connect(){
 | 
			
		||||
 | 
			
		||||
    if success=$(grep -i 'erfolgreich aktiviert\|successfully activated' ${wg_wdir}.tmp.txt)
 | 
			
		||||
        then
 | 
			
		||||
            nmcli con mod "$selection" connection.autoconnect no 
 | 
			
		||||
            nmcli con mod $selection connection.autoconnect no 
 | 
			
		||||
            wg_notify    
 | 
			
		||||
    fi }
 | 
			
		||||
 | 
			
		||||
@@ -238,7 +238,7 @@ if selection=$(yad --no-click --list \
 | 
			
		||||
                --button=$"More":"bash -c more" --button=$"Remove":"bash -c remove" --separator="" \
 | 
			
		||||
                --window-icon=${wg_pic}wg-vpn.png \
 | 
			
		||||
                --borders=8 --image-on-top --image=${wg_pic}wg-active.png \
 | 
			
		||||
                --column=$"Selection" "$tunnel" \
 | 
			
		||||
                --column=$"Selection" $tunnel \
 | 
			
		||||
                --text=$"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$active</b></span> 
 | 
			
		||||
<b>----------------------------------------------------------------------------------</b>  
 | 
			
		||||
<b>If no tunnels are listed,</b> 
 | 
			
		||||
@@ -246,13 +246,13 @@ if selection=$(yad --no-click --list \
 | 
			
		||||
 | 
			
		||||
    then 
 | 
			
		||||
 | 
			
		||||
        if [[ -n "$active" ]]
 | 
			
		||||
        if [[ -n $active ]]
 | 
			
		||||
            then
 | 
			
		||||
                wg_stop
 | 
			
		||||
                nmcli connection up "$selection" &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                nmcli connection up $selection &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                connect
 | 
			
		||||
        else
 | 
			
		||||
                nmcli connection up "$selection" &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                nmcli connection up $selection &> ${wg_wdir}.tmp.txt
 | 
			
		||||
                connect
 | 
			
		||||
        fi
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user