⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sighup.exp

📁 samba-3.0.22.tar.gz 编译smb服务器的源码
💻 EXP
字号:
## @(#) Check services file reloaded after SIGHUP#load_lib "util-defs.exp"# Create a smb.conf file from a list of sections.  Each section consists of# a name and a list of lines which are the contents of that section.# Returns a temporary filename which must be deleted after use.proc write_smb_conf { args } {    # Set up temporary file    set name "/tmp/smb.conf-test-[pid]"    set f [open $name "w"]    # Parse sections    foreach section [lindex $args 0] {	set secname [lindex $section 0]	set contents [lindex $section 1]		puts $f "\[$secname]"	foreach { line } $contents {	    puts $f "\t$line"	}	puts $f ""    }    close $f    # Return filename of smb.conf file    return $name}proc append_smb_conf { args } {        set name [lindex $args 0]    set f [open $name "a"]        foreach section [lindex $args 1] {	set secname [lindex $section 0]	set contents [lindex $section 1]		puts $f "\[$secname]"	foreach { line } $contents {	    puts $f "\t$line"	}	puts $f ""    }    close $f}# Create a smb.conf fileset smb_conf [list \	[list "global" \	    [list "netbios name = testing" \	          "guest ok = true"]]]set name [write_smb_conf $smb_conf]# Run smbd and smbclient outputset smbd_output [util_start "bin/smbd" "-s $name"]set nmbd_output [util_start "bin/nmbd" "-s $name"]sleep 5set smbclient_output [util_start "bin/smbclient -L //testing -N"]verbose $smbclient_outputif { ![regexp "Anonymous login successful" $smbclient_output] } {    untested "smbd could not be started"    util_start "killall" "smbd nmbd"    file delete $name    return}# Append another share and sighupappend_smb_conf $name [list [list "tmp" [list "browseable = true"]]]set output [util_start "killall" "-HUP smbd"]verbose $outputsleep 2set smbclient_output2 [util_start "bin/smbclient -L //testing -N"]verbose $smbclient_output2if { [regexp "tmp.*Disk" $smbclient_output2] } {    pass "sighup reload"} else {    fail "sighup reload"}# Clean uputil_start "killall" "smbd nmbd"file delete $name

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -