source: trunk/klask-wrapper @ 89

Last change on this file since 89 was 89, checked in by g7moreau, 13 years ago
  • Add a wrapper to command line and file config test
File size: 789 bytes
Line 
1#!/bin/bash
2#
3# 2011/03/30 gabriel - create
4
5
6check_conf() {
7   if [ ! -r /etc/klask.conf ]
8   then
9      echo "No config file for klask /etc/klask.conf"
10           exit 1
11   fi
12   if [ ! -r /etc/klask/push-web.conf ]
13   then
14      echo "No config file for klask-push-web /etc/klask/push-web.conf"
15           exit 1
16   fi
17   if [ ! -x /usr/sbin/klask ]
18   then
19      echo "No main program klask"
20           exit 1
21   fi
22   if [ ! -x /usr/lib/klask/push-web ]
23   then
24      echo "No program klask push-web"
25           exit 1
26   fi
27   }
28
29case "$1" in
30  update)
31      check_conf
32      /usr/sbin/klask updatedb
33      /usr/lib/klask/push-web
34      ;;
35
36  clean)
37      check_conf
38      /usr/sbin/klask cleandb
39      /usr/lib/klask/push-web
40      ;;
41
42  *)
43           echo "Usage: $0 {update|clean}"
44           exit 1
45      ;;
46esac
47
48exit 0
Note: See TracBrowser for help on using the repository browser.