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
sredird(8)							      sredird								sredird(8)

NAME
sredird - RFC 2217 serial port server SYNOPSIS
sredird [-i] log-level serial-device lock-file [poll-interval] DESCRIPTION
This manual page documents briefly the sredird, program. This program when run through inetd will use the RFC 2217 extensions to TELNET to implement serial commands over the TCP connection and interface to a specified serial port. OPTIONS
An optional first parameter is '-i' to enable compatability with Cisco IOS. The first mandatory parameter is the log level for use in syslog. The next mandatory parameter is the device node for the serial device, it must be a fully qualified path. The final mandatory parameter is the file name for the lock file to be used to prevent multiple instances of sredird from talking to the serial port at the same time, or to allow sharing a port between modem and sredird. EXAMPLE
Here is a configuration line for running it from inetd: sredir stream tcp nowait root /usr/sbin/tcpd /usr/sbin/sredird 5 /dev/modem /var/lock/LCK..modem AUTHOR
This man page was written by Russell Coker <russell@coker.com.au>. May be freely used and distributed without restriction under the terms of the GPL. The sredird program was written by Denis Sbragion <d.sbragion@infotecna.it> and Jeffrey Altman <jaltman@columbia.edu>. Russell Coker <;russell@coker.com.au> 2.2.0 sredird(8)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy