perf: 重构目录结构

This commit is contained in:
TsMask
2025-03-14 18:25:41 +08:00
parent 9befa00fd4
commit b3bb2d788f
430 changed files with 7167 additions and 12958 deletions

View File

@@ -0,0 +1,38 @@
#!/bin/bash
tooldir=/usr/local/bin
toollist="zip unzip"
# distribute to hosts in file nehosts
while read line
do
if [[ "$line" =~ ^[^[:space:]]*# || -z "$line" ]]; then
continue
fi
user=`echo $line | cut -d " " -f 2`
ip=`echo $line | cut -d " " -f 1`
passwd=`echo $line | cut -d " " -f 3`
for toolname in $toollist;do
expect <<EOF
set timeout 10
spawn scp $tooldir/$toolname $user@$ip:/tmp
expect {
"yes/no" { send "yes\n";exp_continue }
"password" { send "$passwd\n" }
}
expect "password" { send "$passwd\n" }
EOF
done
for toolname in $toollist;do
expect <<EOF
set timeout 10
spawn ssh $user@$ip sudo mv /tmp/$toolname $tooldir
expect {
"yes/no" { send "yes\n";exp_continue }
"password" { send "$passwd\n" }
}
expect "password" { send "$passwd\n" }
EOF
done
done < nehosts