Browse Source

Use `head -n 1'. Provide missing argument to ${MT_STATUS}. Fixed typo in MT_OFFLINE assignment. Proposed by Jan Merka.

Sergey Poznyakoff 20 years ago
parent
commit
f04c7701fa
1 changed files with 6 additions and 6 deletions
  1. 6 6
      scripts/backup.sh.in

+ 6 - 6
scripts/backup.sh.in

@@ -45,7 +45,7 @@ mt_status() {
 # The main configuration file may override any of these variables
 # The main configuration file may override any of these variables
 MT_BEGIN=mt_begin
 MT_BEGIN=mt_begin
 MT_REWIND=mt_rewind
 MT_REWIND=mt_rewind
-MT_OFFLINE=mt_offl
+MT_OFFLINE=mt_offline
 MT_STATUS=mt_status
 MT_STATUS=mt_status
 
 
 # Insure `mail' is in PATH.
 # Insure `mail' is in PATH.
@@ -104,12 +104,12 @@ test_root() {
     if [ ! -w ${ROOT_FS-/} ]; then
     if [ ! -w ${ROOT_FS-/} ]; then
 	bailout "The backup must be run as root or else some files will fail to be dumped."
 	bailout "The backup must be run as root or else some files will fail to be dumped."
     fi
     fi
-    case "${ROOT_FS}" in
-    */)	  ;;
-    *)	  ROOT_FS="${ROOT_FS}/"
-    esac
 }
 }
 
 
+root_fs() {
+    echo "${ROOT_FS}$1" | tr -s /
+}    
+
 advice() {
 advice() {
     echo "Directory $1 is not found." >&2
     echo "Directory $1 is not found." >&2
     cat >&2 <<EOF
     cat >&2 <<EOF
@@ -278,7 +278,7 @@ flush_level_log() {
 # usage: get_dump_time LEVEL
 # usage: get_dump_time LEVEL
 get_dump_time() {
 get_dump_time() {
     ls -r ${LOGPATH}/log-*-level-$1 \
     ls -r ${LOGPATH}/log-*-level-$1 \
-        | head -1 \
+        | head -n 1 \
 	| sed "s,.*log-\(.*\)-level-$1,\1,"
 	| sed "s,.*log-\(.*\)-level-$1,\1,"
 }
 }