This commit was generated by cvs2svn to compensate for changes in r10640,
[freeside.git] / torrus / setup_tools / mkvardir.sh.in
1 #!@SHELL@
2 #  Copyright (C) 2002  Stanislav Sinyagin
3 #
4 #  This program is free software; you can redistribute it and/or modify
5 #  it under the terms of the GNU General Public License as published by
6 #  the Free Software Foundation; either version 2 of the License, or
7 #  (at your option) any later version.
8 #
9 #  This program is distributed in the hope that it will be useful,
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #  GNU General Public License for more details.
13 #
14 #  You should have received a copy of the GNU General Public License
15 #  along with this program; if not, write to the Free Software
16 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17
18 # $Id: mkvardir.sh.in,v 1.1 2010-12-27 00:04:39 ivan Exp $
19 # Stanislav Sinyagin <ssinyagin@yahoo.com>
20 #
21
22 dir=$1
23 user=@var_user@
24 group=@var_group@
25 mode=@var_mode@
26 SHELL=@SHELL@
27
28 if test ! -d $dir; then
29
30     @install_sh@ -d $dir || exit 1
31
32     if test "@enable_varperm@" = "yes"; then
33
34         if test "x@host_os@" != "xcygwin"; then
35             test -z "$user"  && user=torrus
36             test -z "$group" && group=torrus
37             test -z "$mode"  && mode=775
38         fi
39
40         test -z "$mode" || chmod $mode  $dir || (rmdir $dir; exit 1)
41         test -z "$user"  || chown $user  $dir || (rmdir $dir; exit 1)
42         test -z "$group" || (chgrp $group $dir && chmod g+s $dir) || \
43           (rmdir $dir; exit 1)
44
45     fi
46     
47 fi
48
49 exit 0
50
51
52
53 # Local Variables:
54 # mode: shell-script
55 # indent-tabs-mode: nil
56 # perl-indent-level: 4
57 # End: