diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2009-04-23 16:13:33 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2009-04-23 16:13:33 +0000 |
commit | 62c780abe45a54f704a8502d3c4d2d4a2aade41c (patch) | |
tree | c04446f15bca977bf0768e127d842170a108ef30 /sci-misc/boinc/files | |
parent | Bump to 1.3.102. Fixes #258249 (diff) | |
download | gentoo-2-62c780abe45a54f704a8502d3c4d2d4a2aade41c.tar.gz gentoo-2-62c780abe45a54f704a8502d3c4d2d4a2aade41c.tar.bz2 gentoo-2-62c780abe45a54f704a8502d3c4d2d4a2aade41c.zip |
Some gentoo syntax improvement in init.d file.
(Portage version: 2.2_rc30/cvs/Linux x86_64)
Diffstat (limited to 'sci-misc/boinc/files')
-rw-r--r-- | sci-misc/boinc/files/boinc.init | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/sci-misc/boinc/files/boinc.init b/sci-misc/boinc/files/boinc.init index 3735c4bd12f1..6e31db676682 100644 --- a/sci-misc/boinc/files/boinc.init +++ b/sci-misc/boinc/files/boinc.init @@ -8,31 +8,31 @@ depend() { } create_work_directory() { - if [[ ! -d $RUNTIMEDIR ]]; then - einfo "Directory $RUNTIMEDIR not existing, creating now." - mkdir $RUNTIMEDIR - chown ${USER}:${GROUP} $RUNTIMEDIR - if [[ ! -d $RUNTIMEDIR ]]; then - eeror "Directory $RUNTIMEDIR could not be created!" + if [[ ! -d ${RUNTIMEDIR} ]]; then + einfo "Directory ${RUNTIMEDIR} not existing, creating now." + mkdir ${RUNTIMEDIR} + chown ${USER}:${GROUP} ${RUNTIMEDIR} + if [[ ! -d ${RUNTIMEDIR} ]]; then + eeror "Directory ${RUNTIMEDIR} could not be created!" return 1 fi - ln -s /etc/ssl/certs/ca-certificates.crt $RUNTIMEDIR/ca-bundle.crt + ln -s /etc/ssl/certs/ca-certificates.crt ${RUNTIMEDIR}/ca-bundle.crt fi } generate_logs() { - if [[ ! -f $LOGFILE ]]; then - einfo "No $LOGFILE around. Creating new..." + if [[ ! -f ${LOGFILE} ]]; then + einfo "No ${LOGFILE} around. Creating new..." einfo "For good log rotation is great tool app-admin/logrotate" - touch $LOGFILE - chown ${USER}:${GROUP} $LOGFILE + touch ${LOGFILE} + chown ${USER}:${GROUP} ${LOGFILE} fi } cuda_check() { if [[ -f /opt/cuda/%LIBDIR%/libcudart.so ]]; then # symlink wont harm :] - ln -snf /opt/cuda/%LIBDIR%/libcudart.so $RUNTIMEDIR/libcudart.so + ln -snf /opt/cuda/%LIBDIR%/libcudart.so ${RUNTIMEDIR}/libcudart.so fi } @@ -42,7 +42,7 @@ start() { create_work_directory cuda_check - cd $RUNTIMEDIR + pushd ${RUNTIMEDIR} > /dev/null if [[ ! -f lockfile ]]; then einfo "File $RUNTIMEDIR/lockfile does not exist, assuming first run." @@ -88,7 +88,7 @@ start() { fi fi - eend $RESULT + eend ${RESULT} } attach() { @@ -103,18 +103,19 @@ attach() { fi ebegin "Attaching to project" # we have to work in runtime directory - cd $RUNTIMEDIR + pushd ${RUNTIMEDIR} > /dev/null # boinc does not return 1 when it fails currently - $BOINCBIN --chuid ${USER}:${GROUP} --attach_project $url $key &> /dev/null + ${BOINCBIN} --chuid ${USER}:${GROUP} --attach_project ${url} ${key} &> /dev/null + popd > /dev/null eend $? sleep 10 - tail $LOGFILE + tail ${LOGFILE} } stop() { ebegin "Stopping BOINC" - start-stop-daemon --stop --retry 3 --quiet --exec $BOINCBIN + start-stop-daemon --stop --retry 3 --quiet --exec ${BOINCBIN} eend $? } |