1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#!/bin/sh
. /usr/share/debconf/confmodule
set -e
log() {
logger -t finish-install "$@"
}
partsdir="/usr/lib/finish-install.d"
scriptcount=$(ls "$partsdir"/* | wc -l)
db_progress START 0 $scriptcount finish-install/progress/title
for script in "$partsdir"/*; do
base=$(basename $script | sed 's/[0-9]*//')
if ! db_progress INFO finish-install/progress/$base; then
db_subst finish-install/progress/fallback SCRIPT "$base"
db_progress INFO finish-install/progress/fallback
fi
if [ -x "$script" ] ; then
log "info: Running $script"
# Else needed so we don't loose the exit code
if log-output -t finish-install "$script"; then
:
else
code="$?"
case "$code" in
10)
log "$script backed up"
db_progress STOP
exit 10
;;
11)
log "$script has asked to exit installer"
exit 11
;;
*)
log "warning: $script returned error code $code"
;;
esac
fi
else
log "error: Unable to execute $script"
fi
db_progress STEP 1
done
db_progress STOP
|