LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-23-2010, 06:26 AM   #1
tnght2001
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Rep: Reputation: 0
Network Menu


r...i trying to do Configuring the network Script but i always got error asking
./hk.sh: line 21: unexpected EOF while looking for matching `"'
./hk.sh: line 25: syntax error: unexpected end of file

Why? i ready don't know can you help me pls?

#!/bin/bash
echo "Network Menu"
echo

echo "1) Show network interface card (NIC) info like IP, netmask"
echo "2) Change selected NIC attributes like IP, netmask"
echo "3) Enable/Disable IP forwarding"
echo "4) Exit"
echo -n Enter your menu choice [1-4]: "

read opts

if [ "$opts"="1" ] ; then
for NIC in /sys/class/net/* ; do
INTERFACE=${NIC##*/} udevadm test --action=add $NIC
done

elif [ "opts"="2" ] ; then
vi /etc/sysconfig/network

elif [ "$opts"="4" ] ; then
exit
fi
done

Last edited by tnght2001; 06-23-2010 at 06:56 AM.
 
Old 06-24-2010, 06:44 AM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 174Reputation: 174
Quote:
elif [ "opts"="2" ] ; then
vi /etc/sysconfig/network

elif [ "$opts"="4" ] ; then
you have $opts in second case instead of opts
 
1 members found this post helpful.
Old 06-24-2010, 08:28 PM   #3
tnght2001
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Application Menu (Global Menu) For Ubuntu Netbook Edition 10.10 Is Available Fo LXer Syndicated Linux News 0 05-28-2010 05:00 AM
LXer: Ubuntu 10.04 will bring panel overhaul, social network menu LXer Syndicated Linux News 0 12-18-2009 03:10 AM
PPTP VPNs don't show up in network menu gravij Ubuntu 0 05-24-2007 04:40 AM
Fresh Install Of Distr From Network - Boot Menu, Need to pull up a menu of OS dist to SupermanInNY Linux - Distributions 0 01-22-2006 11:48 AM
Gnome Network Servers Menu Entry Xylon Linux - Networking 2 03-15-2004 11:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration