Debian Codegraph @

lib/get-config-dir-nfs

raw
1 #!/bin/bash
2
3 ### BEGIN SUBROUTINE INFO
4 # Provides-Var:
5 # Requires-Var: $FAI_CONFIG_SRC $FAI
6 # Suggests-Var: $romountopt
7 # Short-Description: get $FAI by mounting it via nfs
8 ### END SUBROUTINE INFO
9
10 server=$(expr match "$FAI_CONFIG_SRC" '.*://\([^/]*\)/.*')
11 if [ -z "$server" ]; then
12 server=$(awk '{if($2 == "/run/rootfsbase") print $1;}' /proc/mounts | grep :/ | cut -d ':' -f 1)
13 fi
14 nfspath=$(expr match "$FAI_CONFIG_SRC" '.*://[^/]*\(/.*\)')
15
16 mount $romountopt $server:$nfspath $FAI &&
17 echo "Configuration space $server:$nfspath mounted to $FAI"
18 task_error 881 $?