зеркало из https://github.com/mozilla/pjs.git
bug 230468, patch by Roland Mainz <Roland.Mainz@informatik.med.uni-giessen.de>
r=bsmedberg sr=leaf mozilla should provide a simple way to run custom shell scripts at mozilla startup and shutdown this allows putting S01* and K01* scripts in $MOZILLA_FIVE_HOME/init.d, which will be executed on startup/shutdown of moz.
This commit is contained in:
Родитель
4cb4310982
Коммит
7732a952ed
|
@ -356,8 +356,9 @@ MOZILLA_SCRIPT=mozilla
|
|||
|
||||
$(MOZILLA_SCRIPT):: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
|
||||
cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \
|
||||
-e "s|%MOZ_USER_DIR%|.mozilla|" \
|
||||
-e "s|%MREDIR%|$(mredir)|" \
|
||||
-e "s|mozilla-bin|$(PROGRAM)|g" > $@
|
||||
-e "s|%MOZILLA-BIN%|$(PROGRAM)|g" > $@
|
||||
chmod +x $@
|
||||
|
||||
libs:: $(MOZILLA_SCRIPT)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# Reserved.
|
||||
#
|
||||
|
||||
## $Id: mozilla.in,v 1.3 2002-08-07 11:46:15 seawood%netscape.com Exp $
|
||||
## $Id: mozilla.in,v 1.4 2004-02-04 00:25:14 cbiesinger%web.de Exp $
|
||||
##
|
||||
## Usage:
|
||||
##
|
||||
|
@ -29,6 +29,38 @@
|
|||
## the mozilla-bin binary to work.
|
||||
##
|
||||
|
||||
moz_startstop_addon_scripts()
|
||||
{
|
||||
MOZ_USER_DIR="%MOZ_USER_DIR%"
|
||||
|
||||
case "${1}" in
|
||||
"start")
|
||||
for i in ${dist_bin}/init.d/S* ${HOME}/${MOZ_USER_DIR}/init.d/S* ; do
|
||||
if [ -r "${i}" ] ; then
|
||||
case "${i}" in
|
||||
*.sh) . "${i}" ;;
|
||||
*) sh "${i}" "start" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
;;
|
||||
"stop")
|
||||
for i in ${HOME}/${MOZ_USER_DIR}/init.d/K* ${dist_bin}/init.d/K* ; do
|
||||
if [ -r "${i}" ] ; then
|
||||
case "${i}" in
|
||||
*.sh) . "${i}" ;;
|
||||
*) sh "${i}" "stop" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
;;
|
||||
*)
|
||||
echo 1>&2 "$0: Internal error in moz_startstop_addon_scripts."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
#uncomment for debugging
|
||||
#set -x
|
||||
|
||||
|
@ -82,7 +114,7 @@ fi
|
|||
script_args=""
|
||||
moreargs=""
|
||||
debugging=0
|
||||
MOZILLA_BIN="mozilla-bin"
|
||||
MOZILLA_BIN="%MOZILLA-BIN%"
|
||||
|
||||
if [ "$OSTYPE" = "beos" ]; then
|
||||
mimeset -F $MOZILLA_BIN
|
||||
|
@ -92,7 +124,7 @@ while [ $# -gt 0 ]
|
|||
do
|
||||
case "$1" in
|
||||
-p | -pure)
|
||||
MOZILLA_BIN="mozilla-bin.pure"
|
||||
MOZILLA_BIN="%MOZILLA-BIN%.pure"
|
||||
shift
|
||||
;;
|
||||
-g | --debug)
|
||||
|
@ -113,8 +145,19 @@ done
|
|||
|
||||
export MRE_HOME
|
||||
eval "set -- $moreargs"
|
||||
|
||||
## Start addon scripts
|
||||
moz_startstop_addon_scripts "start"
|
||||
|
||||
if [ $debugging = 1 ]
|
||||
then
|
||||
echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
|
||||
fi
|
||||
exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
|
||||
(. "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@")
|
||||
exitcode=$?
|
||||
|
||||
## Stop addon scripts
|
||||
moz_startstop_addon_scripts "stop"
|
||||
|
||||
exit $exitcode
|
||||
# EOF.
|
||||
|
|
Загрузка…
Ссылка в новой задаче