File: 10-base-classes

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

# do only execute if this is called on the client being installed. Do not use during fai-diskimage
if [ X$FAI_ACTION = Xinstall ] && ! inside_nfsroot ; then
    exit 0
fi

# Echo architecture
command -v dpkg >&/dev/null && dpkg --print-architecture | tr a-z A-Z

# determin if we are a DHCP client or not
# count the : chars in the argument of ip=
n="${ip//[^:]}"
if [[ $ip =~ ^(on|any|dhcp)$ ]]; then
    echo DHCPC
elif [ ${#n} -lt 6 ]; then
    echo DHCPC
fi

exit 0