forked from STI/Astroport.ONE
47 lines
1.2 KiB
Bash
47 lines
1.2 KiB
Bash
|
#!/bin/bash
|
||
|
# Usage: bash addfile.sh <filename> <mime_type> <file_type>
|
||
|
|
||
|
filename="$1"
|
||
|
mime_type="$2"
|
||
|
file_type="$3"
|
||
|
|
||
|
echo "Processing file: $filename"
|
||
|
echo "MIME type: $mime_type"
|
||
|
echo "File type: $file_type"
|
||
|
|
||
|
# Check file type and perform corresponding treatment
|
||
|
case $file_type in
|
||
|
"video")
|
||
|
if [[ $mime_type == *"video"* ]]; then
|
||
|
# Video processing logic
|
||
|
echo "Video processing..."
|
||
|
# Add more processing steps as needed
|
||
|
else
|
||
|
echo "Invalid file type for video processing"
|
||
|
fi
|
||
|
;;
|
||
|
"audio")
|
||
|
if [[ $mime_type == *"audio"* ]]; then
|
||
|
# Audio processing logic
|
||
|
echo "Audio processing..."
|
||
|
# Add more processing steps as needed
|
||
|
else
|
||
|
echo "Invalid file type for audio processing"
|
||
|
fi
|
||
|
;;
|
||
|
"text")
|
||
|
if [[ $mime_type == *"text"* ]]; then
|
||
|
# Text processing logic
|
||
|
echo "Text processing..."
|
||
|
# Add more processing steps as needed
|
||
|
else
|
||
|
echo "Invalid file type for text processing"
|
||
|
fi
|
||
|
;;
|
||
|
*)
|
||
|
echo "Unknown file type: $file_type"
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
echo "File processing complete."
|