debRpmAutoInstall.sh 314 字节
Newer Older
1
#!/usr/bin/expect 
sangshuduo's avatar
sangshuduo 已提交
2
set packageName [lindex $argv 0]
3
set packageSuffix [lindex $argv 1]
4
set timeout 30 
5
if { ${packageSuffix} == "deb" } {
sangshuduo's avatar
sangshuduo 已提交
6
    spawn  dpkg -i ${packageName}
7
} elseif { ${packageSuffix} == "rpm"} {
sangshuduo's avatar
sangshuduo 已提交
8
    spawn rpm -ivh ${packageName}
9 10 11 12 13
}
expect "*one:"
send  "\r"
expect "*skip:"
send  "\r" 
haoranc's avatar
haoranc 已提交
14

sangshuduo's avatar
sangshuduo 已提交
15
expect eof