home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # $Id: preinst,v 1.15 2002/04/11 02:01:21 laz Exp $
- #
-
- set -e
- [ -n "$DEBUG" ] && set -vx
-
- action=$1
- version=$2
-
- # gimme da debconf
- set +vx
- . /usr/share/debconf/confmodule
- [ -n "$DEBUG" ] && set -vx
-
- if [ "$action" = "upgrade" ] ; then
- # use procps' pgrep if possible
- if which pgrep > /dev/null ; then
- PGREP="pgrep -x "
- else
- # if not, manufacture our own pgrep using awk and ps... sucko
- PGREP=screenmaint_pgrep
-
- screenmaint_pgrep() {
- ps auxww | awk "{
- if (match(\$11,\"screen\")!=0 || match(\$11,\"SCREEN\")!=0) {
- print \$2;
- }
- }"
- }
-
- fi
-
- if dpkg --compare-versions "$version" lt "3.9.5-5" ; then
- if [ ! -z "$($PGREP screen)" ] ; then
- # if they're running an old version and there are screen processes
- # running, then prompt
-
- # reset these no matter what
- db_reset screen/old_upgrade_prompt || true
- db_fset screen/old_upgrade_prompt seen false || true
-
- # then prompt
- db_input high screen/old_upgrade_prompt || true
- db_go || true
-
- # and find out what they said
- db_get screen/old_upgrade_prompt || true
- if [ "$RET" = "false" ]; then
- exit 1
- fi
- fi
- fi
- fi
-
-
-
-