File: get-config-dir-detect

package info (click to toggle)
fai 6.5.2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,084 kB
  • sloc: sh: 6,712; perl: 5,664; makefile: 138
file content (23 lines) | stat: -rwxr-xr-x 576 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

### BEGIN SUBROUTINE INFO
# Provides-Var:
# Requires-Var:    $FAI_CONFIG_SRC
# Suggests-Var:
# Short-Description: get $FAI by local path
### END SUBROUTINE INFO

# detect local config space
# check if /media/data direcort contain a config space
# otherwise try default path

localpath=/media/data/config

if [ -d $localpath ]; then
    echo "Config space detected in $localpath."
    mount --bind $localpath $FAI
elif [ -d /var/lib/fai/config ]; then
    echo "Using default config space in /var/lib/fai/config"
else
    echo "ERROR: No config space deteced."
fi