customization good and more cleaning
authorChris Koeritz <fred@gruntose.com>
Thu, 2 Feb 2017 22:39:53 +0000 (17:39 -0500)
committerChris Koeritz <fred@gruntose.com>
Thu, 2 Feb 2017 22:39:53 +0000 (17:39 -0500)
moving out an old script and relocating some to more rational folders.

16 files changed:
scripts/files/checker_report.sh [deleted file]
scripts/files/dir_zero_entries.sh [deleted file]
scripts/files/dos_perm.sh [deleted file]
scripts/files/easy_perm.sh [deleted file]
scripts/files/exe_perm.sh [deleted file]
scripts/files/fix_game_perms.sh [deleted file]
scripts/files/harsh_perm.sh [deleted file]
scripts/files/normal_perm.sh [deleted file]
scripts/rip_burn/checker_report.sh [new file with mode: 0644]
scripts/security/dos_perm.sh [new file with mode: 0644]
scripts/security/easy_perm.sh [new file with mode: 0644]
scripts/security/exe_perm.sh [new file with mode: 0644]
scripts/security/fix_game_perms.sh [new file with mode: 0644]
scripts/security/harsh_perm.sh [new file with mode: 0644]
scripts/security/normal_perm.sh [new file with mode: 0644]
scripts/testing/run_test_and_verify.sh

diff --git a/scripts/files/checker_report.sh b/scripts/files/checker_report.sh
deleted file mode 100644 (file)
index 3dd649a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-# checker_report: runs the checker utility against all files in a directory,
-# in such a way that the file count can be very high without blowing its
-# mind, and without any extra headers in the report.
-
-source $FEISTY_MEOW_SCRIPTS/core/functions.sh
-
-dirname="$1"; shift
-outfile="$1"; shift  # optional parm.
-
-if [ -z "$dirname" ]; then
-  echo "This script requires one directory on which to make a checker report."
-  echo "Additionally, you can specify an output file as the second parameter."
-  exit 1
-fi
-
-if [ -z "$outfile" ]; then
-  outfile="$HOME/checker_report_$(hostname)_$(date_stringer).txt"
-fi
-
-if [ -f "$outfile" ]; then
-  rm "$outfile"
-fi
-
-temp_file_list="$(mktemp /tmp/file_list_temporary.XXXXXX)"
-
-find "$dirname" -type f >"$temp_file_list"
-###-exec echo \"{}\" ';' 
-while read input_text; do
-  checker -q -b "$input_text" 2>&1 >>"$outfile"
-done <"$temp_file_list"
-
-
diff --git a/scripts/files/dir_zero_entries.sh b/scripts/files/dir_zero_entries.sh
deleted file mode 100644 (file)
index 0f4ec90..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-for i in $*; do
-  dirname="$i"
-
-  # make sure this is not a subversion or CVS directory.
-  if [[ $i =~ .*\.svn.* || $i =~ .*CVS.* ]]; then
-#echo directory matched svn or cvs folder
-    continue;
-  fi
-
-  # only operate on existent dirs.
-  if [ ! -d "$i" ]; then
-    continue;
-  fi
-
-  entries=($(ls -1 "$i"))
-  ent_len=${#entries[*]}
-#echo dir $i has entries:
-#echo ${entries[*]}
-#echo len is $ent_len
-  if [ $ent_len -eq 0 ]; then
-    # this directory has nothing!
-#echo "has zero ents!"
-    echo $i
-  fi
-done
-
diff --git a/scripts/files/dos_perm.sh b/scripts/files/dos_perm.sh
deleted file mode 100644 (file)
index 8912437..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# dos_perm: whacks a directory with the most open set of permissions
-# available to the dos/windoze attrib command.
-
-folder="$1"; shift
-
-if [ -z "$folder" ]; then
-  echo "This program requires a folder to set the permissions on.  That folder and all"
-  echo "files in it will be opened up to as full a permission level as DOS's attrib"
-  echo "command is capable of."
-  exit 3
-fi
-
-folder="${folder}/"  # add a slash to ensure there's at least one after drive letters.
-
-dos_folder=$(echo $folder | sed -e 's/\/\([a-zA-Z]\)\/\(.*\)/\1:\/\2/' | sed -e 's/\//\\\\/g')
-#echo dos folder is $dos_folder
-
-attrib -r -s -h //s //d "$dos_folder\\*"
-
diff --git a/scripts/files/easy_perm.sh b/scripts/files/easy_perm.sh
deleted file mode 100644 (file)
index 6663909..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# easyperm: traverses directory trees and sets the permissions to a completely
-# accessible value (rwxrwxrwx for directories and rw-rw-rw- for files).
-
-declare -a args=("$@")
-
-if [ -z "${args[*]}" ]; then
-  echo "no arguments provided."
-  exit 1;
-fi
-
-for (( i=0; i < ${#args[*]}; i++ )); do
-  current="${args[i]}"
-#  echo "curr is $current"
-
-  find "$current" -type d -exec chmod 777 {} ';'
-# >/dev/null 2>/dev/null
-  find "$current" -type f -exec chmod 666 {} ';'
-# >/dev/null 2>/dev/null
-done
-
diff --git a/scripts/files/exe_perm.sh b/scripts/files/exe_perm.sh
deleted file mode 100644 (file)
index 6d8ed90..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# exeperm sets the permissions to an executable value, as for a directory of
-# binary files.  (rwxr-xr-x for both directories and files)
-
-declare -a args=("$@")
-
-if [ -z "${args[*]}" ]; then
-  echo "no arguments provided."
-  exit 1;
-fi
-
-for (( i=0; i < ${#args[*]}; i++ )); do
-  current="${args[i]}"
-#  echo "curr is $current"
-
-  find "$current" -type d -exec chmod 755 {} ';'
-# >/dev/null 2>/dev/null
-  find "$current" -type f -exec chmod 755 {} ';'
-# >/dev/null 2>/dev/null
-done
-
diff --git a/scripts/files/fix_game_perms.sh b/scripts/files/fix_game_perms.sh
deleted file mode 100644 (file)
index 9d21480..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-# fixes the permissions of files in the local games directory so that
-# everyone can run or read them if the owner could.
-
-sudo find /home/games -type f -perm /100 -exec chmod a+x {} ';'
-sudo find /home/games -type f -perm /400 -exec chmod a+r {} ';'
-
-sudo find /home/games -type d -exec chmod a+rx {} ';'
-
diff --git a/scripts/files/harsh_perm.sh b/scripts/files/harsh_perm.sh
deleted file mode 100644 (file)
index f08c77d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# harshperm traverses directory trees and sets the permissions to a restricted
-# value (rwx------ for directories and rw------- for files).
-
-declare -a args=("$@")
-
-if [ -z "${args[*]}" ]; then
-  echo "no arguments provided."
-  exit 1;
-fi
-
-for (( i=0; i < ${#args[*]}; i++ )); do
-  current="${args[i]}"
-#  echo "curr is $current"
-
-  find "$current" -type d -exec chmod 700 {} ';'
-# >/dev/null 2>/dev/null
-  find "$current" -type f -exec chmod 600 {} ';'
-# >/dev/null 2>/dev/null
-done
diff --git a/scripts/files/normal_perm.sh b/scripts/files/normal_perm.sh
deleted file mode 100644 (file)
index 73a7f94..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# normal_perm: traverses directory trees and sets the permissions to a
-# standard accessibility value.  for fred, this is rwxr-xr-x for directories
-# and rw-r--r-- for files.
-
-declare -a args=("$@")
-
-if [ -z "${args[*]}" ]; then
-  echo "no arguments provided."
-  exit 1;
-fi
-
-for (( i=0; i < ${#args[*]}; i++ )); do
-  current="${args[i]}"
-#  echo "curr is $current"
-  find "$current" -type d -exec chmod 755 {} ';'
-### >/dev/null 2>/dev/null
-  find "$current" -type f -exec chmod 644 {} ';'
-### >/dev/null 2>/dev/null
-done
-
diff --git a/scripts/rip_burn/checker_report.sh b/scripts/rip_burn/checker_report.sh
new file mode 100644 (file)
index 0000000..3dd649a
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# checker_report: runs the checker utility against all files in a directory,
+# in such a way that the file count can be very high without blowing its
+# mind, and without any extra headers in the report.
+
+source $FEISTY_MEOW_SCRIPTS/core/functions.sh
+
+dirname="$1"; shift
+outfile="$1"; shift  # optional parm.
+
+if [ -z "$dirname" ]; then
+  echo "This script requires one directory on which to make a checker report."
+  echo "Additionally, you can specify an output file as the second parameter."
+  exit 1
+fi
+
+if [ -z "$outfile" ]; then
+  outfile="$HOME/checker_report_$(hostname)_$(date_stringer).txt"
+fi
+
+if [ -f "$outfile" ]; then
+  rm "$outfile"
+fi
+
+temp_file_list="$(mktemp /tmp/file_list_temporary.XXXXXX)"
+
+find "$dirname" -type f >"$temp_file_list"
+###-exec echo \"{}\" ';' 
+while read input_text; do
+  checker -q -b "$input_text" 2>&1 >>"$outfile"
+done <"$temp_file_list"
+
+
diff --git a/scripts/security/dos_perm.sh b/scripts/security/dos_perm.sh
new file mode 100644 (file)
index 0000000..8912437
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+# dos_perm: whacks a directory with the most open set of permissions
+# available to the dos/windoze attrib command.
+
+folder="$1"; shift
+
+if [ -z "$folder" ]; then
+  echo "This program requires a folder to set the permissions on.  That folder and all"
+  echo "files in it will be opened up to as full a permission level as DOS's attrib"
+  echo "command is capable of."
+  exit 3
+fi
+
+folder="${folder}/"  # add a slash to ensure there's at least one after drive letters.
+
+dos_folder=$(echo $folder | sed -e 's/\/\([a-zA-Z]\)\/\(.*\)/\1:\/\2/' | sed -e 's/\//\\\\/g')
+#echo dos folder is $dos_folder
+
+attrib -r -s -h //s //d "$dos_folder\\*"
+
diff --git a/scripts/security/easy_perm.sh b/scripts/security/easy_perm.sh
new file mode 100644 (file)
index 0000000..6663909
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# easyperm: traverses directory trees and sets the permissions to a completely
+# accessible value (rwxrwxrwx for directories and rw-rw-rw- for files).
+
+declare -a args=("$@")
+
+if [ -z "${args[*]}" ]; then
+  echo "no arguments provided."
+  exit 1;
+fi
+
+for (( i=0; i < ${#args[*]}; i++ )); do
+  current="${args[i]}"
+#  echo "curr is $current"
+
+  find "$current" -type d -exec chmod 777 {} ';'
+# >/dev/null 2>/dev/null
+  find "$current" -type f -exec chmod 666 {} ';'
+# >/dev/null 2>/dev/null
+done
+
diff --git a/scripts/security/exe_perm.sh b/scripts/security/exe_perm.sh
new file mode 100644 (file)
index 0000000..6d8ed90
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# exeperm sets the permissions to an executable value, as for a directory of
+# binary files.  (rwxr-xr-x for both directories and files)
+
+declare -a args=("$@")
+
+if [ -z "${args[*]}" ]; then
+  echo "no arguments provided."
+  exit 1;
+fi
+
+for (( i=0; i < ${#args[*]}; i++ )); do
+  current="${args[i]}"
+#  echo "curr is $current"
+
+  find "$current" -type d -exec chmod 755 {} ';'
+# >/dev/null 2>/dev/null
+  find "$current" -type f -exec chmod 755 {} ';'
+# >/dev/null 2>/dev/null
+done
+
diff --git a/scripts/security/fix_game_perms.sh b/scripts/security/fix_game_perms.sh
new file mode 100644 (file)
index 0000000..9d21480
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# fixes the permissions of files in the local games directory so that
+# everyone can run or read them if the owner could.
+
+sudo find /home/games -type f -perm /100 -exec chmod a+x {} ';'
+sudo find /home/games -type f -perm /400 -exec chmod a+r {} ';'
+
+sudo find /home/games -type d -exec chmod a+rx {} ';'
+
diff --git a/scripts/security/harsh_perm.sh b/scripts/security/harsh_perm.sh
new file mode 100644 (file)
index 0000000..f08c77d
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+# harshperm traverses directory trees and sets the permissions to a restricted
+# value (rwx------ for directories and rw------- for files).
+
+declare -a args=("$@")
+
+if [ -z "${args[*]}" ]; then
+  echo "no arguments provided."
+  exit 1;
+fi
+
+for (( i=0; i < ${#args[*]}; i++ )); do
+  current="${args[i]}"
+#  echo "curr is $current"
+
+  find "$current" -type d -exec chmod 700 {} ';'
+# >/dev/null 2>/dev/null
+  find "$current" -type f -exec chmod 600 {} ';'
+# >/dev/null 2>/dev/null
+done
diff --git a/scripts/security/normal_perm.sh b/scripts/security/normal_perm.sh
new file mode 100644 (file)
index 0000000..73a7f94
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# normal_perm: traverses directory trees and sets the permissions to a
+# standard accessibility value.  for fred, this is rwxr-xr-x for directories
+# and rw-r--r-- for files.
+
+declare -a args=("$@")
+
+if [ -z "${args[*]}" ]; then
+  echo "no arguments provided."
+  exit 1;
+fi
+
+for (( i=0; i < ${#args[*]}; i++ )); do
+  current="${args[i]}"
+#  echo "curr is $current"
+  find "$current" -type d -exec chmod 755 {} ';'
+### >/dev/null 2>/dev/null
+  find "$current" -type f -exec chmod 644 {} ';'
+### >/dev/null 2>/dev/null
+done
+
index cb03745961bd76c6a4d426bcc2c051fb197261ec..6ca02e6f68bfd645b9b9d5404570286ad3f85120 100644 (file)
@@ -9,5 +9,5 @@ to_run="$1"; shift
 input_file="$1"; shift
 answer_file="$1"; shift
 
-eval "$to_run" < "$input_file" | bash "$FEISTY_MEOW_SCRIPTS/unit_test/verify_correct_input.sh" "$answer_file"
+eval "$to_run" < "$input_file" | bash "$FEISTY_MEOW_SCRIPTS/testing/verify_correct_input.sh" "$answer_file"