OSDN Git Service

3d86a6ac022b9a72b098efc5b020643dc3118e70
[lxcf/lxcf.git] / lxcf / lib / lxcf-parmchk-cname
1 #!/usr/bin/python
2 # copyright (C) 2013 FUJITSU LIMITED All Rights Reserved
3
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; version 2
7 # of the License.
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., 51 Franklin Street, Fifth Floor, Boston, MA  
17 # 02110-1301, USA.
18
19 # -*- coding: utf-8 -*-
20
21 import sys, os, shutil
22 import fcntl
23 from optparse import OptionParser,OptionGroup
24
25 parser = OptionParser()
26
27 (options, args) = parser.parse_args(sys.argv)
28
29 argc = len(args)
30
31 if (argc != 2) :
32   print "usage : lxcf-parmchk-cname val"
33   quit()
34
35 parm = args[1]
36
37 for c in parm :
38   if c.isdigit() or c.isalpha() or (c == '-') or (c == '_') or (c == '#') : 
39     continue
40   else:
41     exit(1)
42
43 exit(0)
44