Zenity form for easy network configuration

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Im doing a zenity form for easy network configuration. The end user just fills in the information and the script does the rest.

Is there a better way to do this?

Any input from you guys is welcome.

Thanks




sudo sed -i.bak '7,8 d' /etc/network/interfaces
sudo sed -i '/inet netmask/d' /etc/network/interfaces
sudo sed -i '/inet nameservers/d' /etc/network/interfaces
sudo sed -i '/inet address/d' /etc/network/interfaces
sudo sed -i '/inet gateway/d' /etc/network/interfaces
sudo sed -i "8a iface eth0 inet static" /etc/network/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /etc/network/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "11a netmask $mask" /etc/network/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "10a gateway $gateway" /etc/network/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /etc/network/interfaces
sudo sed -i "13a iface eth1 inet static" /etc/network/interfaces
sudo sed -i "14a address $ip" /etc/network/interfaces
sudo sed -i "15a gateway $gateway" /etc/network/interfaces
sudo sed -i "16a netmask $mask" /etc/network/interfaces
sudo sed -i "17a dns-nameservers $dns" /etc/network/interfaces
zenity --question --text "Is the information accurate"; echo $?
if [ $? > 0 ];
then
echo "--- do it again ---"
sudo cp home/Test/interfaces /etc/network/ #this copies a interfaces.bak
#over the changed one
sleep 3s
exit
fi


Now i changed to this:



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet address/d '
-e '/inet netmask/d'
-e '/inet nameservers/d'
-e '/inet gateway/d'
-e '/iface eth0 inet static/d'
-e '/iface eth1 inet static/d' /tmp/interfaces
sudo sed -i "8a iface eth0 inet static" /tmp/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /tmp/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "10a netmask $mask" /tmp/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "11a gateway $gateway"/tmp/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /tmp/interfaces
sudo sed -i "13a iface eth1 inet static" /tmp/interfaces
sudo sed -i "14a address $ip" /tmp/interfaces
sudo sed -i "15a gateway $gateway" /tmp/interfaces
sudo sed -i "16a netmask $mask" /tmp/interfaces
sudo sed -i "17a dns-nameservers $dns" /tmp/interfaces
wait 1s;
sudo zenity --text-info --height=500 --width=400 < <(cat /tmp/interfaces)
if ! zenity --question --text "Är alla addresser rätt ifyllda"; then
cp /tmp/interfaces /etc/network/interfaces
exit
fi


And nothing happens... no changes to the file whatsoever..
help? :D










share|improve this question























  • First of all, you don't use sudo in a script, run the script itself as root if you need it. Are you creating a bash script here?
    – dessert
    Oct 11 '17 at 7:10











  • use if ! zenity --question --text "Is the information accurate" ; then …
    – dessert
    Oct 11 '17 at 7:20











  • I recommend shellcheck.net.
    – dessert
    Oct 11 '17 at 7:21














up vote
0
down vote

favorite












Im doing a zenity form for easy network configuration. The end user just fills in the information and the script does the rest.

Is there a better way to do this?

Any input from you guys is welcome.

Thanks




sudo sed -i.bak '7,8 d' /etc/network/interfaces
sudo sed -i '/inet netmask/d' /etc/network/interfaces
sudo sed -i '/inet nameservers/d' /etc/network/interfaces
sudo sed -i '/inet address/d' /etc/network/interfaces
sudo sed -i '/inet gateway/d' /etc/network/interfaces
sudo sed -i "8a iface eth0 inet static" /etc/network/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /etc/network/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "11a netmask $mask" /etc/network/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "10a gateway $gateway" /etc/network/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /etc/network/interfaces
sudo sed -i "13a iface eth1 inet static" /etc/network/interfaces
sudo sed -i "14a address $ip" /etc/network/interfaces
sudo sed -i "15a gateway $gateway" /etc/network/interfaces
sudo sed -i "16a netmask $mask" /etc/network/interfaces
sudo sed -i "17a dns-nameservers $dns" /etc/network/interfaces
zenity --question --text "Is the information accurate"; echo $?
if [ $? > 0 ];
then
echo "--- do it again ---"
sudo cp home/Test/interfaces /etc/network/ #this copies a interfaces.bak
#over the changed one
sleep 3s
exit
fi


Now i changed to this:



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet address/d '
-e '/inet netmask/d'
-e '/inet nameservers/d'
-e '/inet gateway/d'
-e '/iface eth0 inet static/d'
-e '/iface eth1 inet static/d' /tmp/interfaces
sudo sed -i "8a iface eth0 inet static" /tmp/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /tmp/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "10a netmask $mask" /tmp/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "11a gateway $gateway"/tmp/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /tmp/interfaces
sudo sed -i "13a iface eth1 inet static" /tmp/interfaces
sudo sed -i "14a address $ip" /tmp/interfaces
sudo sed -i "15a gateway $gateway" /tmp/interfaces
sudo sed -i "16a netmask $mask" /tmp/interfaces
sudo sed -i "17a dns-nameservers $dns" /tmp/interfaces
wait 1s;
sudo zenity --text-info --height=500 --width=400 < <(cat /tmp/interfaces)
if ! zenity --question --text "Är alla addresser rätt ifyllda"; then
cp /tmp/interfaces /etc/network/interfaces
exit
fi


And nothing happens... no changes to the file whatsoever..
help? :D










share|improve this question























  • First of all, you don't use sudo in a script, run the script itself as root if you need it. Are you creating a bash script here?
    – dessert
    Oct 11 '17 at 7:10











  • use if ! zenity --question --text "Is the information accurate" ; then …
    – dessert
    Oct 11 '17 at 7:20











  • I recommend shellcheck.net.
    – dessert
    Oct 11 '17 at 7:21












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Im doing a zenity form for easy network configuration. The end user just fills in the information and the script does the rest.

Is there a better way to do this?

Any input from you guys is welcome.

Thanks




sudo sed -i.bak '7,8 d' /etc/network/interfaces
sudo sed -i '/inet netmask/d' /etc/network/interfaces
sudo sed -i '/inet nameservers/d' /etc/network/interfaces
sudo sed -i '/inet address/d' /etc/network/interfaces
sudo sed -i '/inet gateway/d' /etc/network/interfaces
sudo sed -i "8a iface eth0 inet static" /etc/network/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /etc/network/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "11a netmask $mask" /etc/network/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "10a gateway $gateway" /etc/network/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /etc/network/interfaces
sudo sed -i "13a iface eth1 inet static" /etc/network/interfaces
sudo sed -i "14a address $ip" /etc/network/interfaces
sudo sed -i "15a gateway $gateway" /etc/network/interfaces
sudo sed -i "16a netmask $mask" /etc/network/interfaces
sudo sed -i "17a dns-nameservers $dns" /etc/network/interfaces
zenity --question --text "Is the information accurate"; echo $?
if [ $? > 0 ];
then
echo "--- do it again ---"
sudo cp home/Test/interfaces /etc/network/ #this copies a interfaces.bak
#over the changed one
sleep 3s
exit
fi


Now i changed to this:



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet address/d '
-e '/inet netmask/d'
-e '/inet nameservers/d'
-e '/inet gateway/d'
-e '/iface eth0 inet static/d'
-e '/iface eth1 inet static/d' /tmp/interfaces
sudo sed -i "8a iface eth0 inet static" /tmp/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /tmp/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "10a netmask $mask" /tmp/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "11a gateway $gateway"/tmp/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /tmp/interfaces
sudo sed -i "13a iface eth1 inet static" /tmp/interfaces
sudo sed -i "14a address $ip" /tmp/interfaces
sudo sed -i "15a gateway $gateway" /tmp/interfaces
sudo sed -i "16a netmask $mask" /tmp/interfaces
sudo sed -i "17a dns-nameservers $dns" /tmp/interfaces
wait 1s;
sudo zenity --text-info --height=500 --width=400 < <(cat /tmp/interfaces)
if ! zenity --question --text "Är alla addresser rätt ifyllda"; then
cp /tmp/interfaces /etc/network/interfaces
exit
fi


And nothing happens... no changes to the file whatsoever..
help? :D










share|improve this question















Im doing a zenity form for easy network configuration. The end user just fills in the information and the script does the rest.

Is there a better way to do this?

Any input from you guys is welcome.

Thanks




sudo sed -i.bak '7,8 d' /etc/network/interfaces
sudo sed -i '/inet netmask/d' /etc/network/interfaces
sudo sed -i '/inet nameservers/d' /etc/network/interfaces
sudo sed -i '/inet address/d' /etc/network/interfaces
sudo sed -i '/inet gateway/d' /etc/network/interfaces
sudo sed -i "8a iface eth0 inet static" /etc/network/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /etc/network/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "11a netmask $mask" /etc/network/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "10a gateway $gateway" /etc/network/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /etc/network/interfaces
sudo sed -i "13a iface eth1 inet static" /etc/network/interfaces
sudo sed -i "14a address $ip" /etc/network/interfaces
sudo sed -i "15a gateway $gateway" /etc/network/interfaces
sudo sed -i "16a netmask $mask" /etc/network/interfaces
sudo sed -i "17a dns-nameservers $dns" /etc/network/interfaces
zenity --question --text "Is the information accurate"; echo $?
if [ $? > 0 ];
then
echo "--- do it again ---"
sudo cp home/Test/interfaces /etc/network/ #this copies a interfaces.bak
#over the changed one
sleep 3s
exit
fi


Now i changed to this:



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet address/d '
-e '/inet netmask/d'
-e '/inet nameservers/d'
-e '/inet gateway/d'
-e '/iface eth0 inet static/d'
-e '/iface eth1 inet static/d' /tmp/interfaces
sudo sed -i "8a iface eth0 inet static" /tmp/interfaces
ip=$(zenity --entry --title="Ip adress" --text="Ip adress:")
sudo sed -i "9a address $ip" /tmp/interfaces
mask=$(zenity --entry --title="Netmask" --text="Netmask address:")
sudo sed -i "10a netmask $mask" /tmp/interfaces
gateway=$(zenity --entry --title="Gateway address" --text="Gateway address:")
sudo sed -i "11a gateway $gateway"/tmp/interfaces
dns=$(zenity --entry --title="Dns" --text="Dns address:")
sudo sed -i "12a dns-nameservers $dns" /tmp/interfaces
sudo sed -i "13a iface eth1 inet static" /tmp/interfaces
sudo sed -i "14a address $ip" /tmp/interfaces
sudo sed -i "15a gateway $gateway" /tmp/interfaces
sudo sed -i "16a netmask $mask" /tmp/interfaces
sudo sed -i "17a dns-nameservers $dns" /tmp/interfaces
wait 1s;
sudo zenity --text-info --height=500 --width=400 < <(cat /tmp/interfaces)
if ! zenity --question --text "Är alla addresser rätt ifyllda"; then
cp /tmp/interfaces /etc/network/interfaces
exit
fi


And nothing happens... no changes to the file whatsoever..
help? :D







bash shell-script zenity






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 11 '17 at 8:53









Kusalananda

105k14209326




105k14209326










asked Oct 11 '17 at 7:09









hibridpc

104




104











  • First of all, you don't use sudo in a script, run the script itself as root if you need it. Are you creating a bash script here?
    – dessert
    Oct 11 '17 at 7:10











  • use if ! zenity --question --text "Is the information accurate" ; then …
    – dessert
    Oct 11 '17 at 7:20











  • I recommend shellcheck.net.
    – dessert
    Oct 11 '17 at 7:21
















  • First of all, you don't use sudo in a script, run the script itself as root if you need it. Are you creating a bash script here?
    – dessert
    Oct 11 '17 at 7:10











  • use if ! zenity --question --text "Is the information accurate" ; then …
    – dessert
    Oct 11 '17 at 7:20











  • I recommend shellcheck.net.
    – dessert
    Oct 11 '17 at 7:21















First of all, you don't use sudo in a script, run the script itself as root if you need it. Are you creating a bash script here?
– dessert
Oct 11 '17 at 7:10





First of all, you don't use sudo in a script, run the script itself as root if you need it. Are you creating a bash script here?
– dessert
Oct 11 '17 at 7:10













use if ! zenity --question --text "Is the information accurate" ; then …
– dessert
Oct 11 '17 at 7:20





use if ! zenity --question --text "Is the information accurate" ; then …
– dessert
Oct 11 '17 at 7:20













I recommend shellcheck.net.
– dessert
Oct 11 '17 at 7:21




I recommend shellcheck.net.
– dessert
Oct 11 '17 at 7:21










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










  1. Run the script with sudo. Don't prefix every single command with sudo. Alternatively, make a copy of /etc/network/interfaces as non-root and work on that and then use sudo to copy it back into place.


  2. sed ...; sed ...; sed ... may be replaced by sed -e '...' -e '...' -e '...'.


  3. Testing on $? is not needed.


So what you get is



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet netmask/d'
-e '/inet nameservers/d
(etc.)
-e '8a iface eth0 inet static' /tmp/interfaces
(etc.)

if ! zenity --question --text "Is the information accurate"; then
...
fi





share|improve this answer




















  • check the main question please.. i have an issue .. and i cant really explain it :)
    – hibridpc
    Oct 11 '17 at 8:50










  • @hibridpc I was making a guess on the if test. You may have to remove the !. Also, you still have way too many sed invocations. If you set ip, gateway and mask at the beginning, you should be ok with just one sed.
    – Kusalananda
    Oct 11 '17 at 8:55










  • why do i get "file not found" when i write this command in shell?sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:38











  • sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:40










  • @hibridpc You are trying to run sed on a file called ;.
    – Kusalananda
    Oct 11 '17 at 9:40










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397359%2fzenity-form-for-easy-network-configuration%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










  1. Run the script with sudo. Don't prefix every single command with sudo. Alternatively, make a copy of /etc/network/interfaces as non-root and work on that and then use sudo to copy it back into place.


  2. sed ...; sed ...; sed ... may be replaced by sed -e '...' -e '...' -e '...'.


  3. Testing on $? is not needed.


So what you get is



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet netmask/d'
-e '/inet nameservers/d
(etc.)
-e '8a iface eth0 inet static' /tmp/interfaces
(etc.)

if ! zenity --question --text "Is the information accurate"; then
...
fi





share|improve this answer




















  • check the main question please.. i have an issue .. and i cant really explain it :)
    – hibridpc
    Oct 11 '17 at 8:50










  • @hibridpc I was making a guess on the if test. You may have to remove the !. Also, you still have way too many sed invocations. If you set ip, gateway and mask at the beginning, you should be ok with just one sed.
    – Kusalananda
    Oct 11 '17 at 8:55










  • why do i get "file not found" when i write this command in shell?sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:38











  • sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:40










  • @hibridpc You are trying to run sed on a file called ;.
    – Kusalananda
    Oct 11 '17 at 9:40














up vote
0
down vote



accepted










  1. Run the script with sudo. Don't prefix every single command with sudo. Alternatively, make a copy of /etc/network/interfaces as non-root and work on that and then use sudo to copy it back into place.


  2. sed ...; sed ...; sed ... may be replaced by sed -e '...' -e '...' -e '...'.


  3. Testing on $? is not needed.


So what you get is



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet netmask/d'
-e '/inet nameservers/d
(etc.)
-e '8a iface eth0 inet static' /tmp/interfaces
(etc.)

if ! zenity --question --text "Is the information accurate"; then
...
fi





share|improve this answer




















  • check the main question please.. i have an issue .. and i cant really explain it :)
    – hibridpc
    Oct 11 '17 at 8:50










  • @hibridpc I was making a guess on the if test. You may have to remove the !. Also, you still have way too many sed invocations. If you set ip, gateway and mask at the beginning, you should be ok with just one sed.
    – Kusalananda
    Oct 11 '17 at 8:55










  • why do i get "file not found" when i write this command in shell?sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:38











  • sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:40










  • @hibridpc You are trying to run sed on a file called ;.
    – Kusalananda
    Oct 11 '17 at 9:40












up vote
0
down vote



accepted







up vote
0
down vote



accepted






  1. Run the script with sudo. Don't prefix every single command with sudo. Alternatively, make a copy of /etc/network/interfaces as non-root and work on that and then use sudo to copy it back into place.


  2. sed ...; sed ...; sed ... may be replaced by sed -e '...' -e '...' -e '...'.


  3. Testing on $? is not needed.


So what you get is



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet netmask/d'
-e '/inet nameservers/d
(etc.)
-e '8a iface eth0 inet static' /tmp/interfaces
(etc.)

if ! zenity --question --text "Is the information accurate"; then
...
fi





share|improve this answer












  1. Run the script with sudo. Don't prefix every single command with sudo. Alternatively, make a copy of /etc/network/interfaces as non-root and work on that and then use sudo to copy it back into place.


  2. sed ...; sed ...; sed ... may be replaced by sed -e '...' -e '...' -e '...'.


  3. Testing on $? is not needed.


So what you get is



cp /etc/network/interfaces /tmp/interfaces
sed -i -e '7,8 d'
-e '/inet netmask/d'
-e '/inet nameservers/d
(etc.)
-e '8a iface eth0 inet static' /tmp/interfaces
(etc.)

if ! zenity --question --text "Is the information accurate"; then
...
fi






share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 11 '17 at 7:18









Kusalananda

105k14209326




105k14209326











  • check the main question please.. i have an issue .. and i cant really explain it :)
    – hibridpc
    Oct 11 '17 at 8:50










  • @hibridpc I was making a guess on the if test. You may have to remove the !. Also, you still have way too many sed invocations. If you set ip, gateway and mask at the beginning, you should be ok with just one sed.
    – Kusalananda
    Oct 11 '17 at 8:55










  • why do i get "file not found" when i write this command in shell?sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:38











  • sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:40










  • @hibridpc You are trying to run sed on a file called ;.
    – Kusalananda
    Oct 11 '17 at 9:40
















  • check the main question please.. i have an issue .. and i cant really explain it :)
    – hibridpc
    Oct 11 '17 at 8:50










  • @hibridpc I was making a guess on the if test. You may have to remove the !. Also, you still have way too many sed invocations. If you set ip, gateway and mask at the beginning, you should be ok with just one sed.
    – Kusalananda
    Oct 11 '17 at 8:55










  • why do i get "file not found" when i write this command in shell?sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:38











  • sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
    – hibridpc
    Oct 11 '17 at 9:40










  • @hibridpc You are trying to run sed on a file called ;.
    – Kusalananda
    Oct 11 '17 at 9:40















check the main question please.. i have an issue .. and i cant really explain it :)
– hibridpc
Oct 11 '17 at 8:50




check the main question please.. i have an issue .. and i cant really explain it :)
– hibridpc
Oct 11 '17 at 8:50












@hibridpc I was making a guess on the if test. You may have to remove the !. Also, you still have way too many sed invocations. If you set ip, gateway and mask at the beginning, you should be ok with just one sed.
– Kusalananda
Oct 11 '17 at 8:55




@hibridpc I was making a guess on the if test. You may have to remove the !. Also, you still have way too many sed invocations. If you set ip, gateway and mask at the beginning, you should be ok with just one sed.
– Kusalananda
Oct 11 '17 at 8:55












why do i get "file not found" when i write this command in shell?sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
– hibridpc
Oct 11 '17 at 9:38





why do i get "file not found" when i write this command in shell?sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
– hibridpc
Oct 11 '17 at 9:38













sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
– hibridpc
Oct 11 '17 at 9:40




sudo sed -i '7a iface eth0 inet static' /tmp/interfaces ;
– hibridpc
Oct 11 '17 at 9:40












@hibridpc You are trying to run sed on a file called ;.
– Kusalananda
Oct 11 '17 at 9:40




@hibridpc You are trying to run sed on a file called ;.
– Kusalananda
Oct 11 '17 at 9:40

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397359%2fzenity-form-for-easy-network-configuration%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)