Browse code

merciful release

Nat! authored on 24/10/2013 16:14:59
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+# mulle-spotlight-utilities
1
+
2
+Simple script, that gives some info about your Volumes and Spotlight.
3
+Must be run as root.
4
+Bonus code, for people who can read shell scripts :)
0 5
new file mode 100755
... ...
@@ -0,0 +1,38 @@
0
+#! /bin/sh
1
+# ######################################################################
2
+# Coded by Nat!
3
+# 2013 Mulle kybernetiK  http://www.mulle-kybernetik.com
4
+# 
5
+# $Id$
6
+#
7
+spotlight_check()
8
+{
9
+   for i in /Volumes/*
10
+   do
11
+      echo "$i:" `(mdutil -s "$i" | tail -1)` "Size:" `(du -sh "$i"/.Spotlight-V100 | awk '{ print $1 "." }')` `[ -x "$i"/.Spotlight-V100/Store-V1 ] && echo "$i/.Spotlight-V100 contains obsolete Store-V1."`
12
+   done
13
+}
14
+
15
+
16
+spotlight_rebuild()
17
+{
18
+   for i in /Volumes/*
19
+   do    
20
+      enabled=`(mdutil -s "$i" | tail -1 | awk '{ print $2 }')`
21
+      mdutil -i off "$i"
22
+      rm -rf "$i/.Spotlight-V100"
23
+      if [ "$enabled" = "enabled." ]
24
+      then
25
+         mdutil -i on "$i"
26
+      fi
27
+   done
28
+}
29
+
30
+
31
+spotlight_utilities()
32
+{
33
+   spotlight_check
34
+}
35
+
36
+`basename $0 | tr '-' '_' | sed 's/mulle_\(.*\).sh/\1/g'`
37
+