diff --git a/audioskripte/berechtigungen.sh b/audioskripte/berechtigungen.sh new file mode 100755 index 0000000..f10cc3c --- /dev/null +++ b/audioskripte/berechtigungen.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +DIR=$(dirname $0) + +chown -R :mpd "$DIR" +find "$DIR" -type d -exec chmod g=rx {} \; +find "$DIR" -type f -exec chmod g=r {} \; diff --git a/audioskripte/hierhertaren.sh b/audioskripte/hierhertaren.sh new file mode 100755 index 0000000..1ed7f43 --- /dev/null +++ b/audioskripte/hierhertaren.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +#set -x + +#BASEDIR=$(dirname $0) +BASEDIR=$(pwd -P) +SDIR=$1 + +set -e +cd "$SDIR" +for file in *; do + SUBDIR=$(echo $file | sed 's;.*/\(.*\);\1;' | sed 's/^\(.\).*/\1/' | tr 'A-Z' 'a-z') + DDIR="$BASEDIR/$SUBDIR" + echo "Creating $DDIR" + mkdir -p "$DDIR" + tar c "$file" | ( cd "$DDIR"; tar xv ) +done diff --git a/audioskripte/hierherverschieben.sh b/audioskripte/hierherverschieben.sh new file mode 100755 index 0000000..9d803b9 --- /dev/null +++ b/audioskripte/hierherverschieben.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +#set -x + +BASEDIR=$(dirname $0) +FILE=$1 + +SUBDIR=$(echo $FILE | sed 's;.*/\(.*\);\1;' | sed 's/^\(.\).*/\1/' | tr 'A-Z' 'a-z') + +DDIR="$BASEDIR/$SUBDIR" +set -e +echo "Creating $DDIR" +mkdir -p "$DDIR" +echo "Moving $FILE to $DDIR" +mv "$FILE" "$DDIR"