#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/pre-setup-packages-menu # # Creation: 2012-02-24 hbfl # Last Update: $Id$ # # Copyright (c) 2012-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /var/install/include/eislib # set pidfile to block multiple # instances from packages-menu running PIDFILE="/var/lock/package_menu.pid" if [ -f ${PIDFILE} ] then pid=$(< ${PIDFILE}) # get info, if running without info line, # like 'PID TTY TIME CMD' _running=$(ps -p ${pid} -o comm=) if [ -z "${_running}" ] then rm ${PIDFILE} else case ${_running} in show-menu*) : ;; *) rm ${PIDFILE} ;; esac fi fi if [ ! -f ${PIDFILE} ] then # PPID = Parent Process ID echo "${PPID}" > ${PIDFILE} echo # clean up rm -f /tmp/index.txt rm -f /tmp/_do_all rm -f /tmp/_have_require rm -f /tmp/required_{libs,packages,dev_packages,static_packages}_found* # eisman rm -f /run/eisman-installed # eisman update else echo mecho --warn "The package administration menu is currently used by another" mecho --warn "instance. Please exit this other instance to use package" mecho --warn "administration here." echo # musst by exit code 2 # to handle in show-menu correct exit 2 fi # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------