diff options
author | 2009-11-18 09:56:05 +0000 | |
---|---|---|
committer | 2009-11-18 09:56:05 +0000 | |
commit | 362173651f57e7bbe30df155031740ed5cddba7b (patch) | |
tree | 6f1516e0724287bf0fb9d44d26bbed7268334ffa /dev-util/schroot/files | |
parent | Version bump. (diff) | |
download | gentoo-2-362173651f57e7bbe30df155031740ed5cddba7b.tar.gz gentoo-2-362173651f57e7bbe30df155031740ed5cddba7b.tar.bz2 gentoo-2-362173651f57e7bbe30df155031740ed5cddba7b.zip |
fix init script, revbump
Diffstat (limited to 'dev-util/schroot/files')
-rw-r--r-- | dev-util/schroot/files/schroot.initd | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/dev-util/schroot/files/schroot.initd b/dev-util/schroot/files/schroot.initd index a9a15e2349fb..76ca9944532d 100644 --- a/dev-util/schroot/files/schroot.initd +++ b/dev-util/schroot/files/schroot.initd @@ -5,33 +5,32 @@ depend() { after net netmount } -recover_sessions() { - einfo "Recovering schroot sessions" - eindent - local chroot - local chroots="$(schroot --all-sessions --list --quiet)" - if [ -n "${chroots}" ]; then - for chroot in ${chroots}; do - ebegin "$chroot" - schroot --chroot=$chroot --recover-session - eend $? - done - else - einfo "(none)" - fi - eoutdent - einfo "...done" -} +start() { + local msg param + case "${SESSIONS_RECOVER}" in + end) + msg="Ending" + param="--end-session" + ;; + recover|"") + msg="Recovering" + param="--recover-session" + ;; + *) + ewarn "Invalid value \"$SESSIONS_RECOVER\" for \$SESSIONS_RECOVER, using \"recover\"" + msg="Recovering" + param="--recover-session" + ;; + esac -end_sessions() { - einfo "Ending schroot sessions" + einfo "$msg schroot sessions" eindent local chroot local chroots="$(schroot --all-sessions --list --quiet)" - if [ -n "${chroots}" ]; then - for chroot in ${chroots}; do + if [ -n "$chroots" ]; then + for chroot in $chroots; do ebegin "$chroot" - schroot --chroot=$chroot --recover-session + schroot --chroot=$chroot $param eend $? done else @@ -40,11 +39,3 @@ end_sessions() { eoutdent einfo "...done" } - -start() { - if [ "${SESSIONS_RECOVER}" = "end" ]; then - end_sessions - else - recover_sessions - fi -} |