File: network.tcl

package info (click to toggle)
moodss 9.0-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,540 kB
  • ctags: 609
  • sloc: sh: 8,869; tcl: 6,909; ansic: 113; makefile: 44
file content (28 lines) | stat: -rw-r--r-- 1,250 bytes parent folder | download | duplicates (2)
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
# copyright (C) 1997-1999 Jean-Luc Fontaine (mailto:jfontain@multimania.com)
# this program is free software: please read the COPYRIGHT file enclosed in this package or use the Help Copyright menu

set rcsId {$Id: network.tcl,v 1.2 1999/07/23 21:19:06 jfontain Exp $}

package provide network 1.3

namespace eval network {

    proc parseRemoteLocator {string} {                                                                  ;# return user and host list
        set string [string trim $string]
        if {[string match *@* $string]} {                                                                     ;# user@host specified
            return [split $string @]
        } else {                                                                                              ;# only host specified
            return [list $::env(USER) $string]                                                                   ;# use current user
        }
    }

    proc checkRemoteOutputEmptiness {host} {
        catch "exec /usr/bin/rsh $host test" output
        if {[string length $output]>0} {
            puts stderr "remote host \"$host\" shell output should be empty, got instead:"
            puts stderr $output
            exit 1
        }
    }

}