File: mac.exp

package info (click to toggle)
conman 0.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 1,424 kB
  • sloc: ansic: 11,173; sh: 4,072; exp: 2,132; makefile: 153; perl: 122
file content (25 lines) | stat: -rwxr-xr-x 557 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/expect --

##
# $Id: mac.exp 500 2005-02-10 02:19:46Z dun $
#   by Chris Dunlap <cdunlap@llnl.gov>
##

set env(PATH) "/bin:/usr/bin:/usr/local/bin"
source /usr/lib/conman/conman.exp
source /usr/lib/conman/alpha.exp
log_user 0

proc print_mac_addrs {spawn_id output_id console} {
#
  set macs [alpha_get_mac_addrs $spawn_id $output_id $console err]
  if {[llength $macs] == 0} {
    exp_send -i $output_id "ERROR: $err.\n"
    return
  }
  foreach mac $macs {
    exp_send -i $output_id "[join $mac]\n"
  }
}

conman_run 256 $argv print_mac_addrs