|
Revision 1105, 0.8 kB
(checked in by alpt, 1 year ago)
|
--
|
- Property svn:eol-style set to
native
- Property svn:executable set to
*
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
#!/bin/bash |
|---|
| 2 |
|
|---|
| 3 |
yesorno() { |
|---|
| 4 |
echo "Press Enter to continue or write \"no\" to skip $1" |
|---|
| 5 |
printf "> " |
|---|
| 6 |
read -r what |
|---|
| 7 |
|
|---|
| 8 |
case $what in |
|---|
| 9 |
no) return 1 ;; |
|---|
| 10 |
''| yes) return 0 ;; |
|---|
| 11 |
*) yesorno $@ ;; |
|---|
| 12 |
esac |
|---|
| 13 |
} |
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
dstdir=`sed -n '/export CLOSEBRACKET_DIR/ {s/"//g; s/^[^=]*=//p}' ~/.bashrc` |
|---|
| 17 |
|
|---|
| 18 |
if [ -z "$dstdir" ]; then |
|---|
| 19 |
dstdir="`echo ~/.closebracket`" |
|---|
| 20 |
fi |
|---|
| 21 |
|
|---|
| 22 |
SHELL_LIST_FILE="$CLOSEBRACKET_DIR/shells" |
|---|
| 23 |
biglist=`grep -v "^ |
|---|
| 24 |
for d in $biglist |
|---|
| 25 |
do |
|---|
| 26 |
echo Installing on $d |
|---|
| 27 |
yesorno |
|---|
| 28 |
if [ $? == 1 ]; then continue; fi |
|---|
| 29 |
|
|---|
| 30 |
ssh $d "mkdir /tmp/closebracket/; mkdir $dstdir/" |
|---|
| 31 |
scp -r install.sh install-rshells.sh cb scripts/ shells \ |
|---|
| 32 |
closebracket.conf file_extensions $d:/tmp/closebracket |
|---|
| 33 |
|
|---|
| 34 |
ssh $d "cd /tmp/closebracket/; ./install.sh donotask $dstdir &> install.log" |
|---|
| 35 |
|
|---|
| 36 |
scp -r $dstdir/shells $d:$dstdir/ |
|---|
| 37 |
done |
|---|
| 38 |
|
|---|
| 39 |
echo "All done" |
|---|