pkill vpn terminates all my script
up vote
0
down vote
favorite
I am working with a Dialog GUI.
./sdvpn.sh
is the code for the GUI main menu, shown below.
./killvpn.sh
is a script containing only one command, sudo pkill vpn
./region.sh
is a Dialog menu allowing to specify the country you desire your VPN to connect to.
When I want to kill any active OpenVPN connections, I select option 2 on the menu below:
`#!/bin/bash
#Main Menu
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="VPN"
TITLE="Main Menu"
MENU="Choose an Option: "
OPTIONS=(1 "VPN Menu"
2 "Kill Active VPN")
CHOICE=$(dialog --clear
--backtitle "$BACKTITLE"
--title "$TITLE"
--menu "$MENU"
$HEIGHT $WIDTH $CHOICE_HEIGHT
"${OPTIONS[@]}"
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
cd ~/VPN/gui
./region.sh
;;
2)
cd ~/VPN/scripts
./killvpn.sh
cd ~/VPN
./sdvpn.sh
;;
esac`
This code for Option 2 is supposed to achieve the following:
- lead to my Scripts directory
- Exectute
sudo pkill vpn
- Return to the main folder where my main menu.sh is kept
- Run the main menu, taking the process full circle.
The Problem
It will not return to the main menu, and I have no way to troubleshoot this. The same methodology worked perfectly when rolled out on Kali Linux 2018.2.
When I execute sudo pkill vpn
or my killvpn.sh
file, it simply kills the VPN connections as expected. However when running the same script from the Dialog GUI, I receive a message which says "Terminated."
I have tried rerouting the killvpn.sh
to activate the Dialog GUI as part of its script, but the same problem occured.
I have then tried, with both sudo pkill vpn
and killvpn.sh
to include the sleep command, as I was simply returned to the terminal, and believed this was a process it could execute in order to continue running the code, but this failed too.
I am now unable to kill the VPN from my GUI, and I would like to know if there was a way I can either remove the "Terminated." message, or a way to accomplish my task. As a bonus ball, I would be grateful if someone could explain to me under what conditions will pkill vpn
display this message, so I can avoid it in the future.
command-line bash scripts vpn openvpn
add a comment |
up vote
0
down vote
favorite
I am working with a Dialog GUI.
./sdvpn.sh
is the code for the GUI main menu, shown below.
./killvpn.sh
is a script containing only one command, sudo pkill vpn
./region.sh
is a Dialog menu allowing to specify the country you desire your VPN to connect to.
When I want to kill any active OpenVPN connections, I select option 2 on the menu below:
`#!/bin/bash
#Main Menu
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="VPN"
TITLE="Main Menu"
MENU="Choose an Option: "
OPTIONS=(1 "VPN Menu"
2 "Kill Active VPN")
CHOICE=$(dialog --clear
--backtitle "$BACKTITLE"
--title "$TITLE"
--menu "$MENU"
$HEIGHT $WIDTH $CHOICE_HEIGHT
"${OPTIONS[@]}"
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
cd ~/VPN/gui
./region.sh
;;
2)
cd ~/VPN/scripts
./killvpn.sh
cd ~/VPN
./sdvpn.sh
;;
esac`
This code for Option 2 is supposed to achieve the following:
- lead to my Scripts directory
- Exectute
sudo pkill vpn
- Return to the main folder where my main menu.sh is kept
- Run the main menu, taking the process full circle.
The Problem
It will not return to the main menu, and I have no way to troubleshoot this. The same methodology worked perfectly when rolled out on Kali Linux 2018.2.
When I execute sudo pkill vpn
or my killvpn.sh
file, it simply kills the VPN connections as expected. However when running the same script from the Dialog GUI, I receive a message which says "Terminated."
I have tried rerouting the killvpn.sh
to activate the Dialog GUI as part of its script, but the same problem occured.
I have then tried, with both sudo pkill vpn
and killvpn.sh
to include the sleep command, as I was simply returned to the terminal, and believed this was a process it could execute in order to continue running the code, but this failed too.
I am now unable to kill the VPN from my GUI, and I would like to know if there was a way I can either remove the "Terminated." message, or a way to accomplish my task. As a bonus ball, I would be grateful if someone could explain to me under what conditions will pkill vpn
display this message, so I can avoid it in the future.
command-line bash scripts vpn openvpn
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am working with a Dialog GUI.
./sdvpn.sh
is the code for the GUI main menu, shown below.
./killvpn.sh
is a script containing only one command, sudo pkill vpn
./region.sh
is a Dialog menu allowing to specify the country you desire your VPN to connect to.
When I want to kill any active OpenVPN connections, I select option 2 on the menu below:
`#!/bin/bash
#Main Menu
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="VPN"
TITLE="Main Menu"
MENU="Choose an Option: "
OPTIONS=(1 "VPN Menu"
2 "Kill Active VPN")
CHOICE=$(dialog --clear
--backtitle "$BACKTITLE"
--title "$TITLE"
--menu "$MENU"
$HEIGHT $WIDTH $CHOICE_HEIGHT
"${OPTIONS[@]}"
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
cd ~/VPN/gui
./region.sh
;;
2)
cd ~/VPN/scripts
./killvpn.sh
cd ~/VPN
./sdvpn.sh
;;
esac`
This code for Option 2 is supposed to achieve the following:
- lead to my Scripts directory
- Exectute
sudo pkill vpn
- Return to the main folder where my main menu.sh is kept
- Run the main menu, taking the process full circle.
The Problem
It will not return to the main menu, and I have no way to troubleshoot this. The same methodology worked perfectly when rolled out on Kali Linux 2018.2.
When I execute sudo pkill vpn
or my killvpn.sh
file, it simply kills the VPN connections as expected. However when running the same script from the Dialog GUI, I receive a message which says "Terminated."
I have tried rerouting the killvpn.sh
to activate the Dialog GUI as part of its script, but the same problem occured.
I have then tried, with both sudo pkill vpn
and killvpn.sh
to include the sleep command, as I was simply returned to the terminal, and believed this was a process it could execute in order to continue running the code, but this failed too.
I am now unable to kill the VPN from my GUI, and I would like to know if there was a way I can either remove the "Terminated." message, or a way to accomplish my task. As a bonus ball, I would be grateful if someone could explain to me under what conditions will pkill vpn
display this message, so I can avoid it in the future.
command-line bash scripts vpn openvpn
I am working with a Dialog GUI.
./sdvpn.sh
is the code for the GUI main menu, shown below.
./killvpn.sh
is a script containing only one command, sudo pkill vpn
./region.sh
is a Dialog menu allowing to specify the country you desire your VPN to connect to.
When I want to kill any active OpenVPN connections, I select option 2 on the menu below:
`#!/bin/bash
#Main Menu
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="VPN"
TITLE="Main Menu"
MENU="Choose an Option: "
OPTIONS=(1 "VPN Menu"
2 "Kill Active VPN")
CHOICE=$(dialog --clear
--backtitle "$BACKTITLE"
--title "$TITLE"
--menu "$MENU"
$HEIGHT $WIDTH $CHOICE_HEIGHT
"${OPTIONS[@]}"
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
cd ~/VPN/gui
./region.sh
;;
2)
cd ~/VPN/scripts
./killvpn.sh
cd ~/VPN
./sdvpn.sh
;;
esac`
This code for Option 2 is supposed to achieve the following:
- lead to my Scripts directory
- Exectute
sudo pkill vpn
- Return to the main folder where my main menu.sh is kept
- Run the main menu, taking the process full circle.
The Problem
It will not return to the main menu, and I have no way to troubleshoot this. The same methodology worked perfectly when rolled out on Kali Linux 2018.2.
When I execute sudo pkill vpn
or my killvpn.sh
file, it simply kills the VPN connections as expected. However when running the same script from the Dialog GUI, I receive a message which says "Terminated."
I have tried rerouting the killvpn.sh
to activate the Dialog GUI as part of its script, but the same problem occured.
I have then tried, with both sudo pkill vpn
and killvpn.sh
to include the sleep command, as I was simply returned to the terminal, and believed this was a process it could execute in order to continue running the code, but this failed too.
I am now unable to kill the VPN from my GUI, and I would like to know if there was a way I can either remove the "Terminated." message, or a way to accomplish my task. As a bonus ball, I would be grateful if someone could explain to me under what conditions will pkill vpn
display this message, so I can avoid it in the future.
command-line bash scripts vpn openvpn
command-line bash scripts vpn openvpn
asked Nov 22 at 16:53
tREEs
19514
19514
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
In this case, I found that using the command
sudo killall openvpn
was both a more effective way of terminating OpenVPN Connections, and also avoided the dialog I got with sudo pkill vpn
allowing me to return to the dialog menu without any issues.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
In this case, I found that using the command
sudo killall openvpn
was both a more effective way of terminating OpenVPN Connections, and also avoided the dialog I got with sudo pkill vpn
allowing me to return to the dialog menu without any issues.
add a comment |
up vote
0
down vote
In this case, I found that using the command
sudo killall openvpn
was both a more effective way of terminating OpenVPN Connections, and also avoided the dialog I got with sudo pkill vpn
allowing me to return to the dialog menu without any issues.
add a comment |
up vote
0
down vote
up vote
0
down vote
In this case, I found that using the command
sudo killall openvpn
was both a more effective way of terminating OpenVPN Connections, and also avoided the dialog I got with sudo pkill vpn
allowing me to return to the dialog menu without any issues.
In this case, I found that using the command
sudo killall openvpn
was both a more effective way of terminating OpenVPN Connections, and also avoided the dialog I got with sudo pkill vpn
allowing me to return to the dialog menu without any issues.
answered Nov 22 at 17:06
tREEs
19514
19514
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1095158%2fpkill-vpn-terminates-all-my-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown