From 546041ba3113a4a58d8f3e7e7cb90e78fcb38ea8 Mon Sep 17 00:00:00 2001 From: Thomas Gellekum Date: Wed, 5 Jul 2000 12:37:06 +0000 Subject: As threatened on freebsd-ports: all startup scripts know about the two options `start' and `stop' now (unless I have forgotten any). This allows us to call the scripts from /etc/rc.shutdown with the correct option. The (42 or so) ports that already DTRT before are unchanged. --- japanese/elvis/Makefile | 17 +---------------- japanese/elvis/files/ja-elvis.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 japanese/elvis/files/ja-elvis.sh (limited to 'japanese/elvis') diff --git a/japanese/elvis/Makefile b/japanese/elvis/Makefile index cc18cdf7a226..6ebe7ad00db5 100644 --- a/japanese/elvis/Makefile +++ b/japanese/elvis/Makefile @@ -34,22 +34,7 @@ post-install: @${SH} ${PKGDIR}/REQ ${PKGNAME} INSTALL @if [ ! -f ${STARTUP_SCRIPT} ]; then \ ${ECHO} "Installing ${STARTUP_SCRIPT} startup file."; \ - ${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT}; \ - ${ECHO} 'virecovery=`${ECHO} /var/tmp/elv_*`' \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} 'if [ "$$virecovery" != '"'/var/tmp/elv_*' ]; then" \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} " ${ECHO} 'Recovering ja-elvis editor sessions'" \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} ' for i in $$virecovery; do' \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} " ${PREFIX}/bin/elvprsv "'$$i' \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} ' done' \ - >> ${STARTUP_SCRIPT}; \ - ${ECHO} 'fi' >> ${STARTUP_SCRIPT}; \ - ${CHMOD} 755 ${STARTUP_SCRIPT}; \ - ${CHOWN} bin.bin ${STARTUP_SCRIPT}; \ + ${INSTALL_SCRIPT} ${FILESDIR}/ja-elvis.sh ${STARTUP_SCRIPT};\ fi .include diff --git a/japanese/elvis/files/ja-elvis.sh b/japanese/elvis/files/ja-elvis.sh new file mode 100644 index 000000000000..10c4b961a0c7 --- /dev/null +++ b/japanese/elvis/files/ja-elvis.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + virecovery=`echo /var/tmp/elv_*` + if [ "$virecovery" != '/var/tmp/elv_*' ]; then + echo 'Recovering ja-elvis editor sessions' + for i in $$virecovery; do + ${PREFIX}/bin/elvprsv "$i" + done + fi + ;; +stop) + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 -- cgit v1.2.3