From fb44d3eabeceecb90678d881543efae6a95f6ae9 Mon Sep 17 00:00:00 2001 From: atratsevskiy Date: Thu, 30 Jul 2009 13:05:24 +0000 Subject: [PATCH] git-svn-id: http://svn.calculate.ru/calculate/trunk@2244 c91db197-33c1-4113-bf15-f8a5c547ca64 --- install/scratch | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/install/scratch b/install/scratch index be0ce80..a355c4c 100755 --- a/install/scratch +++ b/install/scratch @@ -76,19 +76,37 @@ umountres() { } -if ! mount | grep /mnt/scratch &>/dev/null -then - echo "This program only works in the system, installed by Calculate with the option '--scratch'." - exit; -fi +#------------------------------------------------------------------------------ +# Выполним проверки +#------------------------------------------------------------------------------ +checkrun() { + if ! mount | grep /mnt/scratch &>/dev/null + then + echo "This program only works in the system, installed by Calculate with the option '--scratch'." + exit; + fi + + if ps ax | grep "/bin/bash /usr/bin/scratch" &>/dev/null + then + echo "This program is already run." + exit; + fi +} -# Перенесем resolv.conf -if [ -f /etc/resolv.conf ] -then - mkdir -p ${BUILDER}/etc - cp /etc/resolv.conf ${BUILDER}/etc/ -fi +#------------------------------------------------------------------------------ +# Выполним предварительные настройки +#------------------------------------------------------------------------------ +configure() { + # Перенесем resolv.conf + if [ -f /etc/resolv.conf ] + then + mkdir -p ${BUILDER}/etc + cp /etc/resolv.conf ${BUILDER}/etc/ + fi +} -mountres && runchroot $* +checkrun +configure +mountres && runchroot umountres