|
|
|
@ -76,19 +76,37 @@ umountres() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
# Выполним проверки
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
# Выполним предварительные настройки
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|