aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/fix_extensions.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/fix_extensions.sh b/bin/fix_extensions.sh
new file mode 100755
index 0000000..e3ddd67
--- /dev/null
+++ b/bin/fix_extensions.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+for file in $1/*; do
+ TYPE=$(file --mime-type -b "$file" | cut -f2 -d/);
+ if [[ ! $file =~ \.$TYPE ]]; then
+ mv -v "$file" "$file.$TYPE";
+ fi
+done