r3568@krups: intrigeri | 2005-11-17 22:25:05 +0100

dup.helper: some code cleaning
This commit is contained in:
intrigeri 2005-11-29 10:11:14 +00:00
parent fbd3c3d84c
commit b27f7e71b6

View File

@ -8,15 +8,15 @@ do_dup_host_includes() {
REPLY= REPLY=
while [ -z "$REPLY" ]; do while [ -z "$REPLY" ]; do
formBegin "$dup_title - host system: includes" formBegin "$dup_title - host system: includes"
for ((i=0; i < ${#dup_default_includes[@]} ; i++)); do for i in $dup_default_includes; do
formItem include ${dup_default_includes[$i]} formItem include "$i"
done done
formItem include "" formItem include ""
formItem include "" formItem include ""
formItem include "" formItem include ""
formDisplay formDisplay
[ $? = 0 ] || return 1 [ $? = 0 ] || return 1
dup_includes=($REPLY) dup_includes="$REPLY"
done done
set +o noglob set +o noglob
} }
@ -31,15 +31,15 @@ do_dup_vserver() {
REPLY= REPLY=
while [ -z "$REPLY" ]; do while [ -z "$REPLY" ]; do
formBegin "$dup_title - vservers: includes" formBegin "$dup_title - vservers: includes"
for ((i=0; i < ${#dup_default_includes[@]} ; i++)); do for i in $dup_default_includes; do
formItem include ${dup_default_includes[$i]} formItem include "$i"
done done
formItem include "" formItem include ""
formItem include "" formItem include ""
formItem include "" formItem include ""
formDisplay formDisplay
[ $? = 0 ] || return 1 [ $? = 0 ] || return 1
dup_vsincludes=($REPLY) dup_vsincludes="$REPLY"
done done
set +o noglob set +o noglob
} }
@ -47,15 +47,15 @@ do_dup_vserver() {
do_dup_excludes() { do_dup_excludes() {
set -o noglob set -o noglob
formBegin "$dup_title: excludes" formBegin "$dup_title: excludes"
for ((i=0; i < ${#dup_default_excludes[@]} ; i++)); do for i in $dup_default_excludes; do
formItem exclude ${dup_default_excludes[$i]} formItem exclude "$i"
done done
formItem exclude "" formItem exclude ""
formItem exclude "" formItem exclude ""
formItem exclude "" formItem exclude ""
formDisplay formDisplay
[ $? = 0 ] || return 1 [ $? = 0 ] || return 1
dup_excludes=($REPLY) dup_excludes="$REPLY"
set +o noglob set +o noglob
} }
@ -260,8 +260,8 @@ EOF
if [ "$host_or_vservers" == host -o "$host_or_vservers" == both ]; then if [ "$host_or_vservers" == host -o "$host_or_vservers" == both ]; then
set -o noglob set -o noglob
for ((i=0; i < ${#dup_includes[@]} ; i++)); do for i in $dup_includes; do
echo "include = ${dup_includes[$i]}" >> $next_filename echo "include = $i" >> $next_filename
done done
set +o noglob set +o noglob
fi fi
@ -285,8 +285,8 @@ EOF
if [ "$host_or_vservers" == vservers -o "$host_or_vservers" == both ]; then if [ "$host_or_vservers" == vservers -o "$host_or_vservers" == both ]; then
set -o noglob set -o noglob
echo -e "vsnames = \"$selected_vservers\"\n" >> $next_filename echo -e "vsnames = \"$selected_vservers\"\n" >> $next_filename
for ((i=0; i < ${#dup_vsincludes[@]} ; i++)); do for i in $dup_vsincludes; do
echo "vsinclude = ${dup_vsincludes[$i]}" >> $next_filename echo "vsinclude = $i" >> $next_filename
done done
set +o noglob set +o noglob
fi fi
@ -299,8 +299,8 @@ EOF
# (supports globbing with '*') # (supports globbing with '*')
EOF EOF
set -o noglob set -o noglob
for ((i=0; i < ${#dup_excludes[@]} ; i++)); do for i in $dup_excludes; do
echo exclude = ${dup_excludes[$i]} >> $next_filename echo "exclude = $i" >> $next_filename
done done
set +o noglob set +o noglob
@ -423,8 +423,8 @@ dup_wizard() {
# Global variables whose '*' shall not be expanded # Global variables whose '*' shall not be expanded
set -o noglob set -o noglob
dup_default_includes=(/var/spool/cron/crontabs /var/backups /etc /root /home /usr/local/*bin /var/lib/dpkg/status*) dup_default_includes="/var/spool/cron/crontabs /var/backups /etc /root /home /usr/local/*bin /var/lib/dpkg/status*"
dup_default_excludes=(/home/*/.gnupg) dup_default_excludes="/home/*/.gnupg"
set +o noglob set +o noglob
dup_main_menu dup_main_menu