Debian Codegraph @

lib/get-config-dir-detect

raw
1 #!/bin/bash
2
3 ### BEGIN SUBROUTINE INFO
4 # Provides-Var:
5 # Requires-Var: $FAI_CONFIG_SRC
6 # Suggests-Var:
7 # Short-Description: get $FAI by local path
8 ### END SUBROUTINE INFO
9
10 # detect local config space
11 # check if /media/data direcort contain a config space
12 # otherwise try default path
13
14 localpath=/media/data/config
15
16 if [ -d $localpath ]; then
17 echo "Config space detected in $localpath."
18 mount --bind $localpath $FAI
19 elif [ -d /var/lib/fai/config ]; then
20 echo "Using default config space in /var/lib/fai/config"
21 else
22 echo "ERROR: No config space deteced."
23 fi