File: mac.exp

package info (click to toggle)
conman 0.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,600 kB
  • sloc: ansic: 11,863; sh: 2,174; exp: 2,132; makefile: 270; perl: 120
file content (29 lines) | stat: -rwxr-xr-x 951 bytes parent folder | download
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
26
27
28
29
#!/usr/bin/expect --
###############################################################################
# Written by Chris Dunlap <cdunlap@llnl.gov>.
# Copyright (C) 2007-2022 Lawrence Livermore National Security, LLC.
# Copyright (C) 2001-2007 The Regents of the University of California.
# UCRL-CODE-2002-009.
#
# This file is part of ConMan: The Console Manager.
# For details, see <https://dun.github.io/conman/>.
###############################################################################

set env(PATH) "/bin:/usr/bin:/usr/local/bin"
source /usr/share/conman/lib/conman.exp
source /usr/share/conman/lib/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