tracking down some rogue chmods
[feisty_meow.git] / scripts / core / create_tempdir.sh
index 55899274889144cd1a771bbaec30bfde468af3fc..c435d2dd9751f6045af2e8b4bedf8c82f8917166 100644 (file)
@@ -5,26 +5,22 @@
 # This creates a temporary directory for transient files if such a directory
 # does not already exist.
 
-if [ ! -z "$SHELL_DEBUG" ]; then echo creating temporary directory...; fi
+if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo creating temporary directory...; fi
 
 if [ -z "$TMP" ]; then
+  # main declaration of the transients area.
   export TMP=$HOME/.tmp
-    # main declaration of the transients area.
-  if [ "$OS" = "Windows_NT" ]; then
-    export TMP=c:/tmp
-  fi
 fi
 
-LOG_FILE=$TMP/zz_transients.log
-  # log file for this script.
+source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
 
-word=Verified
 if [ ! -d "$TMP" ]; then
-  mkdir $TMP
-  word=Created
-fi
-if [ -z "$LIGHTWEIGHT_INIT" ]; then
-  echo "$word transient area \"$TMP\" for $USER on $(date_stringer)." >>$LOG_FILE
+  mkdir -p $TMP
+  chown $USER $TMP
+  if [ $? -ne 0 ]; then
+    echo "failed to chown $TMP to user's ownership."
+  fi
+  log_feisty_meow_event "created transient area \"$TMP\" for $USER on $(date_stringer)." 
 fi
 
 # set other temporary variables to the same place as TMP.
@@ -32,6 +28,7 @@ export TEMP=$TMP
 
 # Make sure no one else is playing around in the temporary directory.
 chmod 700 $TMP
+continue_on_error chmodding to secure temporary directory.
 
-if [ ! -z "$SHELL_DEBUG" ]; then echo done creating temporary directory....; fi
+if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo done creating temporary directory....; fi