Sponsored Content
Special Forums IP Networking Configure IP Based on HW Serial # Post 302562004 by injector on Wednesday 5th of October 2011 05:03:32 PM
Old 10-05-2011
Quote:
Originally Posted by bartus11
Try:
Code:
serial=`sudo /usr/sbin/dmidecode -t 1 | grep -e 'Serial Number' | cut -f 2`
if [ $serial=="1234" ]; then
  ifconfig eth0 inet 1.1.1.1/8
fi

bartus, that works wonderfully but when i execute it as a script it tells me

Code:
[root@localhost Desktop]# ./test
./test: line 2: [: Number:: binary operator expected

could it have something to do with the fact that the serial number contains letters too?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

serial communication

This isn't really a unix question, or even a programming question, but I hope you guys can help. I want to create a program to control the electricity on a model railway. I have created the program to that it sends characters over the serial cable, but now I need to do the switch that will... (1 Reply)
Discussion started by: KrazyGuyPaul
1 Replies

2. IP Networking

TCP over serial

Here's my config: One quadra 840av working under netBSD and successfully connected to my network. One PM 6100 connected but not booting fully into netBSD (i realize this is faulty but I figured it was worth a shot to try and install netBSD/mac68k on it due to the fact it is unsupported under the... (1 Reply)
Discussion started by: Yummator
1 Replies

3. Programming

What is the difference between console-based and xwindow-based application?

Hi everyone, What is the difference between console-based and Xwindow-based application? Can I say the application working well in Xwindows can work in console? Can I say the application working well in console cann't work in Xwindow perhaps. Eg, ncurses is console-based and Imlib2 is... (4 Replies)
Discussion started by: liuyan03
4 Replies

4. Ubuntu

Ubuntu 9.04 Serial application to telnet to serial device

Hello! I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a... (5 Replies)
Discussion started by: mvona
5 Replies

5. Shell Programming and Scripting

How to fetch rows based on line numbers or based on the beginning of a word?

I have a file which will have rows like shown below, ST*820*316054716 RMR*IV*11333331009*PO*40.31 REF*IV*22234441009*xsss471-2762 DTM*003*091016 ENT*000006 RMR*IV*2222234444*PO*239.91 REF*IV*1234445451009*LJhjlkhkj471-2762 </SPAN> DTM*003* 091016 RMR*IV*2223344441009*PO*40.31... (18 Replies)
Discussion started by: Muthuraj K
18 Replies

6. Shell Programming and Scripting

Need help with serial port

Hi, I have a external board connected to my serial port. I need to execute "shutdown -r now" command when system boot up. When system boots up it requires a username ans password. Then I need to run my command. I can use rc script but that is rebooting system before it asks for username and... (0 Replies)
Discussion started by: charlie.arya
0 Replies

7. UNIX for Advanced & Expert Users

Transition from Windows-based network to Linux-based

I am looking to make the switch from a Windows based network to a Linux (preferably Ubuntu, because I used it the most) based one. Currently the network includes a Windows 2003 server which acts as a domain controller and file server, a network shared printer (Canon 2300N) and 7 clients running... (2 Replies)
Discussion started by: larynx
2 Replies

8. HP-UX

Help with serial ports.

Hi, This is my first post here. I would like to ask: how to connect the barcode scanner to the serial port? What are the names in the system (in / dev) and serialport1 serialport0? Please help with this. Regards. (2 Replies)
Discussion started by: ftwojtek
2 Replies

9. Solaris

Can we configure link based IPMP in private connectivity in Oracle RAC

Hi I would like to know whether we can configure link based IPMP in private connectivity in Oracle RAC Regarsd ---------- Post updated at 04:35 PM ---------- Previous update was at 04:27 PM ---------- Here I am taking about in case of private connectivity through cross cable (6 Replies)
Discussion started by: sb200
6 Replies

10. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies
SL(4)							   BSD Kernel Interfaces Manual 						     SL(4)

NAME
sl -- Serial Line IP (SLIP) network interface SYNOPSIS
pseudo-device sl DESCRIPTION
The sl interface allows asynchronous serial lines to be used as IPv4 network interfaces using the SLIP protocol. To use the sl interface, the administrator must first create the interface and assign a tty line to it. The sl interface is created using the ifconfig(8) create subcommand, and slattach(8) is used to assign a tty line to the interface. Once the interface is attached, network source and destination addresses and other parameters are configured via ifconfig(8). The sl interface can use Van Jacobson TCP header compression and ICMP filtering. The following flags to ifconfig(8) control these properties of a SLIP link: link0 Turn on Van Jacobson header compression. -link0 Turn off header compression. (default) link1 Don't pass through ICMP packets. -link1 Do pass through ICMP packets. (default) link2 If a packet with a compressed header is received, automatically enable compression of outgoing packets. (default) -link2 Don't auto-enable compression. DIAGNOSTICS
sl%d: af%d not supported . The interface was handed a message with addresses formatted in an unsuitable address family; the packet was dropped. SEE ALSO
inet(4), intro(4), ppp(4), strip(4), ifconfig(8), slattach(8), sliplogin(8), slstats(8) J. Romkey, A Nonstandard for Transmission of IP Datagrams over Serial Lines: SLIP, RFC, 1055, June 1988. Van Jacobson, Compressing TCP/IP Headers for Low-Speed Serial Links, RFC, 1144, February 1990. HISTORY
The sl device appeared in NetBSD 1.0. BUGS
SLIP can only transmit IPv4 packets between preconfigured hosts on an asynchronous serial link. It has no provision for address negotiation, carriage of additional protocols (e.g. XNS, AppleTalk, DECNET), and is not designed for synchronous serial links. This is why SLIP has been superseded by the Point-to-Point Protocol (PPP), which does all of those things, and much more. BSD
July 9, 2006 BSD
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy