Skip to content

Commit

Permalink
Make rear aware if it is in recovery mode (using RECOVERY_MODE)
Browse files Browse the repository at this point in the history
This fixes #59
  • Loading branch information
dagwieers committed Jun 8, 2012
1 parent 1199ef9 commit f035085
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions usr/sbin/rear
Expand Up @@ -55,6 +55,7 @@ SIMULATE=
VERBOSE=
DEBUG=
KEEP_BUILD_DIR=
RECOVERY_MODE=

# Parse options
OPTS="$(getopt -n $PROGRAM -o "dDhsSvVr:" -l "help,version" -- "$@")"
Expand Down Expand Up @@ -177,6 +178,11 @@ if [[ "$DEBUG" ]]; then
KEEP_BUILD_DIR=1
fi

# check if we are in recovery mode
if [[ -e "/etc/rear-release" ]]; then
RECOVERY_MODE="y"
fi

[[ -z "$SIMULATE" ]]
LogPrintIfError "Simulation mode activated, Rear base directory: $SHARE_DIR"

Expand Down
12 changes: 8 additions & 4 deletions usr/share/rear/lib/help-workflow.sh
Expand Up @@ -40,16 +40,20 @@ $(
for workflow in ${WORKFLOWS[@]} ; do
description=WORKFLOW_${workflow}_DESCRIPTION
if [[ "${!description}" ]]; then
printf " %-16s%s\n" $workflow "${!description}"
if [[ -z "$RECOVERY_MODE" && "$workflow" != "recover" ]]; then
printf " %-16s%s\n" $workflow "${!description}"
elif [[ "$RECOVERY_MODE" && "$workflow" == "recover" ]]; then
printf " %-16s%s\n" $workflow "${!description}"
fi
fi
done
)
EOF

#if [[ -z "$VERBOSE" ]]; then
# echo "Use 'rear -v help' for more advanced commands."
#fi
if [[ -z "$VERBOSE" ]]; then
echo "Use 'rear -v help' for more advanced commands."
fi

EXIT_CODE=1
}
2 changes: 1 addition & 1 deletion usr/share/rear/lib/recover-workflow.sh
Expand Up @@ -18,7 +18,7 @@
#
#

WORKFLOW_recover_DESCRIPTION="recover the system; only valid during rescue"
WORKFLOW_recover_DESCRIPTION="recover the system"
WORKFLOWS=( ${WORKFLOWS[@]} recover )
WORKFLOW_recover () {

Expand Down

0 comments on commit f035085

Please sign in to comment.