From 1b8f04909963f55301b9e2caf796fd1ba0b768e6 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 10 Dec 2012 10:55:14 +0100 Subject: keep every 100th screenshot --- bin/g-i-installation.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'bin/g-i-installation.sh') diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh index 72fdd216..f1485375 100755 --- a/bin/g-i-installation.sh +++ b/bin/g-i-installation.sh @@ -178,18 +178,21 @@ monitor_installation() { if [ $(($NR % 150)) -eq 0 ] ; then vncdo -s $DISPLAY key ctrl fi - # if this screenshot is the same as the one 400 screenshots ago, let stop this - if [ $(($NR % 100)) -eq 0 ] && [ $NR -gt 400 ] ; then - # from help let: "Exit Status: If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." - let OLD=NR-400 + # take a screenshot for later publishing + if [ $(($NR % 100)) -eq 0 ] ; then set -x - if diff -q snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $OLD).ppm ; then - echo ERROR snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $OLD).ppm match, ending installation. - cp snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $NR).ppm.bak - cp snapshot_$(printf "%06d" $OLD).ppm snapshot_$(printf "%06d" $OLD).ppm.bak - ls -la snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $OLD).ppm - figlet "Installation hangs." - break + cp snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $NR).ppm.bak + # if this screenshot is the same as the one 400 screenshots ago, let stop this + if [ $NR -gt 400 ] ; then + # from help let: "Exit Status: If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." + let OLD=NR-400 + if diff -q snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $OLD).ppm ; then + echo ERROR snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $OLD).ppm match, ending installation. + cp snapshot_$(printf "%06d" $OLD).ppm snapshot_$(printf "%06d" $OLD).ppm.bak + ls -la snapshot_$(printf "%06d" $NR).ppm snapshot_$(printf "%06d" $OLD).ppm + figlet "Installation hangs." + break + fi fi set +x fi -- cgit v1.2.3-70-g09d2