home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / utils / file / logiso.000 / logiso / Utils / RCS / logiso_init,v < prev    next >
Encoding:
Text File  |  1995-03-24  |  2.5 KB  |  161 lines

  1. head    1.4;
  2. access;
  3. symbols
  4.     VER_0_3:1.4
  5.     VER_0_2:1.3;
  6. locks; strict;
  7. comment    @# @;
  8.  
  9.  
  10. 1.4
  11. date    95.03.24.11.43.35;    author coulter;    state Exp;
  12. branches;
  13. next    1.3;
  14.  
  15. 1.3
  16. date    95.03.10.02.42.22;    author coulter;    state Exp;
  17. branches;
  18. next    1.2;
  19.  
  20. 1.2
  21. date    95.02.19.16.06.41;    author coulter;    state Exp;
  22. branches;
  23. next    1.1;
  24.  
  25. 1.1
  26. date    95.02.19.09.10.40;    author coulter;    state Exp;
  27. branches;
  28. next    ;
  29.  
  30.  
  31. desc
  32. @Script to initialize the mirror directory with top-level symbolic links.
  33. @
  34.  
  35.  
  36. 1.4
  37. log
  38. @Checkin version for 0.3 distribution.
  39. @
  40. text
  41. @#! /bin/bash
  42. USAGE='USAGE: logiso_init [ -d config_prefix ]
  43.    Initialize MAP_TO_PATH to mirror the top level of MOUNT_PATH
  44. '
  45. # (C) Copyright 1995 by Michael Coulter.  All rights reserved.
  46.  
  47. # Process parameters
  48.  
  49.    CONFIG_PREFIX=""
  50.    if [ $# -ge 2 -a "$1" = "-d" ]
  51.    then
  52.       shift  # done with -d
  53.       CONFIG_PREFIX="$1"; shift
  54.    fi
  55.    if [ $# -ne 0 ]
  56.    then
  57.       echo "$USAGE" >&2
  58.       echo "Too many arguments." >&2
  59.       exit 1
  60.    fi
  61.  
  62. # Set variables
  63.  
  64.    ISOFS_UTIL_DIR="${ISOFS_UTIL_DIR:-/usr/src/linux/fs/isofs/Utils}"
  65.  
  66. # Source in user definitions
  67. # MOUNT_PATH
  68. # MAP_TO_PATH
  69. # CD_FILE
  70.  
  71.    . "${ISOFS_UTIL_DIR}/${CONFIG_PREFIX}config"
  72.    export ISOFS_UTIL_DIR
  73.  
  74. # Define standard functions
  75.  
  76.    . "$ISOFS_UTIL_DIR/ksh_fns"
  77.  
  78. # Check for root
  79.  
  80.    if [ "$EUID" -ne 0 ]
  81.    then
  82.       echo "$USAGE" >&2
  83.       echo "You are not root. Do you want to continue (type y for yes)?" >&2
  84.       read RESPONSE
  85.       if [ "$RESPONSE" != "y" ]
  86.       then
  87.      exit 1
  88.       fi
  89.    fi
  90.  
  91. # do it
  92.  
  93.    if [ "${MAP_TO_PATH}" != "/" ]
  94.    then
  95.       echo "About to replace $MAP_TO_PATH and everything below it." >&2
  96.       echo "Type y for yes to confirm:" >&2
  97.       read RESPONSE
  98.       if [ "$RESPONSE" != "y" ]
  99.       then
  100.      exit 1
  101.       fi
  102.       check_cmd 10 rm -rf "$MAP_TO_PATH"
  103.       check_cmd 12 mkdir "$MAP_TO_PATH"
  104.    fi
  105.    check_cmd 14 cd "$MOUNT_PATH"     
  106.    for FILE in * .??* .[^.]
  107.    do
  108.       if [ -e "$FILE" ]
  109.       then
  110.          if [ "$MAP_TO_PATH" = "/" ]
  111.          then
  112.         ln -s "$MOUNT_PATH/$FILE" "/$FILE"
  113.          else
  114.         ln -s "$MOUNT_PATH/$FILE" "$MAP_TO_PATH/$FILE"
  115.          fi
  116.       fi
  117.    done
  118.    check_links -d "$CONFIG_PREFIX" "$MAP_TO_PATH"  > /dev/null
  119.    exit 0
  120. @
  121.  
  122.  
  123. 1.3
  124. log
  125. @Checkin files modified to make version 0.2
  126. @
  127. text
  128. @d5 1
  129. @
  130.  
  131.  
  132. 1.2
  133. log
  134. @Checkpoint version 0.1
  135. @
  136. text
  137. @d2 1
  138. a2 1
  139. USAGE='USAGE: logiso_init
  140. d8 6
  141. d30 1
  142. a30 1
  143.    . "${ISOFS_UTIL_DIR}/config"
  144. d77 1
  145. a77 1
  146.    check_links "$MAP_TO_PATH"  > /dev/null
  147. @
  148.  
  149.  
  150. 1.1
  151. log
  152. @Initial revision
  153. @
  154. text
  155. @d46 1
  156. a46 1
  157.    if [ "$(dirname "$MAP_TO_PATH")" != "/" ]
  158. d50 1
  159. d71 1
  160. @
  161.