Debian Codegraph @

bin/fai-mk-configspace

raw symbols SCIP
1 #! /bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 # create a initial config space
4
5 usagescip-shell shell fai 6.6 usage().() {
6
7 catscip-shell system . . cat. <<EOF
8
9 fai-mk-configspace - set up the FAI config space
10
11 Create the directory defined in \$FAI_CONFIGDIR and
12 copy the examples for the FAI config space into it.
13
14 Options:
15 -h|--help display this help message
16
17 EOF
18 exit 0
19 }
20
21
22
23 TEMP=$(getoptscip-shell system . . getopt. -o h --long help -n "$0" -- "$@")
24 if [scip-shell system . . `[`. $? != 0 ] ; then die 6 "Wrong option. Terminating." >&2 ; fi
25 eval set -- "$TEMP"
26 unset TEMP
27
28 while truescip-shell system . . true. ; do
29 case "$1" in
30 -h|--help)
31 usagescip-shell shell fai 6.6 usage(). 0 ;;
32 --)
33 shift
34 break ;;
35 *)
36 die 1 "$0: command line parsing error ! $*" >&2 ;;
37 esac
38 done
39
40
41 . /etc/fai/nfsroot.confscip-shell source . . `/etc/fai/nfsroot.conf`.
42
43 if [scip-shell system . . `[`. -d $FAI_CONFIGDIR/class ]; then
44 echoscip-shell system . . echo. "You already have a config space in $FAI_CONFIGDIR"
45 exit 0
46 fi
47
48 if [scip-shell system . . `[`. ! -d /usr/share/doc/fai-docscip-shell filesystem . . `/usr/share/doc/fai-doc`. ]; then
49 echoscip-shell system . . echo. "Cannot create the config space. Please install the package fai-doc."
50 exit 1
51 fi
52
53 if ! mkdirscip-shell system . . mkdir. -p $FAI_CONFIGDIR ; then
54 echoscip-shell system . . echo. "Cannot create the config space in $FAI_CONFIGDIR."
55 exit 1
56 fi
57
58 if cpscip-shell system . . cp. -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR/. ; then
59 echoscip-shell system . . echo. "Your initial config space is now located in $FAI_CONFIGDIR"
60 else
61 echoscip-shell system . . echo. "Copying the config space examples failed."
62 fi