Ignore:
Timestamp:
Oct 2, 2010, 3:23:43 PM (14 years ago)
Author:
Rick van der Zwet
Message:

Question actions proper processing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd-mgnt/system-update.sh

    r190 r191  
    88
    99ask_question() {
     10  # Will return 1 if yes, return 0 if no
    1011  QUESTION=$1
    1112  DEFAULT=$2
     
    1516
    1617}
    17 
    1818
    1919if [ `id -u` -ne 0 ]; then
     
    7070  if [ -n "$RC_FILES" ]; then
    7171    echo $RC_FILES
    72     ask_question "Do you like to stop your deamons" "yes" || exit
    73     for RC_FILE in $RC_FILES; do
    74       $RC_FILE stop
    75     done
     72    ask_question "Do you like to stop your deamons" "yes" && {
     73      for RC_FILE in $RC_FILES; do
     74        $RC_FILE stop
     75      done
     76    }
    7677  fi
    7778fi
     
    8283if [ -n "$RC_FILES" ]; then
    8384  echo $RC_FILES
    84   ask_question "Do you like to restart your deamons" "yes" || exit
    85   for RC_FILE in $RC_FILES; do
    86     $RC_FILE restart
    87   done
     85  ask_question "Do you like to restart your deamons" "yes" && {
     86    for RC_FILE in $RC_FILES; do
     87      $RC_FILE restart
     88    done
     89  }
    8890fi
Note: See TracChangeset for help on using the changeset viewer.