summaryrefslogtreecommitdiffstats
path: root/source/a/file/recompile_magic.mgc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/file/recompile_magic.mgc.sh')
-rw-r--r--source/a/file/recompile_magic.mgc.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/a/file/recompile_magic.mgc.sh b/source/a/file/recompile_magic.mgc.sh
new file mode 100644
index 000000000..2ae5ca397
--- /dev/null
+++ b/source/a/file/recompile_magic.mgc.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Recompile the /etc/file/magic.mgc database.
+# This should be done after any additions or changes to the files
+# in /etc/file/magic/.
+
+if [ ! "$UID" = "0" ]; then
+ echo "Error: must be root to recompile the system magic.mgc"
+ exit 1
+fi
+
+cd /etc/file
+/usr/bin/file --compile
+