File: pinot-check-file.sh

package info (click to toggle)
pinot 1.22-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,604 kB
  • sloc: cpp: 41,857; makefile: 609; xml: 416; sh: 336
file content (28 lines) | stat: -rwxr-xr-x 649 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Run this with find, eg find -L ~/Documents/ -exec pinot-check-file.sh {} \;
if [ $# == 0 ]; then
  echo "Usage: $0 FILE"
  exit 1
fi

WHICH_SED=`which sed 2>/dev/null`
if [ $? != 0 ]; then
  echo "Couldn't find sed. Is the sed package installed ?"
  exit 1
fi
WHICH_PI=`which pinot-index 2>/dev/null`
if [ $? != 0 ]; then
  echo "Couldn't find pinot-index. Is the pinot package installed ?"
  exit 1
fi

for FILE in "$@" ;
do
  NO_SLASH_FILE=`echo $FILE | sed -e "s/\(.*\)\/$/\1/g"`
  pinot-index --check --db ~/.pinot/daemon/ "file://$NO_SLASH_FILE" >/dev/null 2>&1 \;
  if [ $? != 0 ]; then
    echo $NO_SLASH_FILE
  fi
done

exit 0