| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | escaperescip-shell shell shell-project 0.0.0 escapere().() |
| 4 | { |
| 5 | sedscip-shell system . . sed. 's/\./\\\\./g' |
| 6 | } |
| 7 | |
| 8 | _HOST="$(hostnamescip-shell system . . hostname. 2>/dev/nullscip-shell filesystem . . `/dev/null`.)" |
| 9 | _FQDN="$(hostnamescip-shell system . . hostname. --fqdn 2>/dev/nullscip-shell filesystem . . `/dev/null`.)" |
| 10 | if [scip-shell system . . `[`. "$?" -eq 1 ]; then |
| 11 | _FQDN="${_HOST}" |
| 12 | fi |
| 13 | _DNSDN="$(dnsdomainnamescip-shell system . . dnsdomainname. 2>/dev/nullscip-shell filesystem . . `/dev/null`.)" |
| 14 | if [scip-shell system . . `[`. "$?" -eq 1 ]; then |
| 15 | _DNSDN="" |
| 16 | fi |
| 17 | if [scip-shell system . . `[`. -n "${_FQDN}" ]; then |
| 18 | printfscip-shell system . . printf. "@@if not defined FQDN\\n" |
| 19 | printfscip-shell system . . printf. "@@define FQDN %s\\n" "$(echoscip-shell system . . echo. "${_FQDN}" | escaperescip-shell shell shell-project 0.0.0 escapere().)" |
| 20 | printfscip-shell system . . printf. "@@endif\\n" |
| 21 | fi |
| 22 | if [scip-shell system . . `[`. -n "${_HOST}" ]; then |
| 23 | printfscip-shell system . . printf. "@@if not defined HOSTNAME\\n" |
| 24 | printfscip-shell system . . printf. "@@define HOSTNAME %s\\n" "$(echoscip-shell system . . echo. "${_HOST}" | escaperescip-shell shell shell-project 0.0.0 escapere().)" |
| 25 | printfscip-shell system . . printf. "@@endif\\n" |
| 26 | fi |
| 27 | if [scip-shell system . . `[`. -n "${_DNSDN}" ]; then |
| 28 | printfscip-shell system . . printf. "@@if not defined DNSDOMAINNAME\\n" |
| 29 | printfscip-shell system . . printf. "@@define DNSDOMAINNAME %s\\n" "$(echoscip-shell system . . echo. "${_DNSDN}" | escaperescip-shell shell shell-project 0.0.0 escapere().)" |
| 30 | printfscip-shell system . . printf. "@@endif\\n" |
| 31 | fi |
| 32 | _ARCH="$(dpkgscip-shell system . . dpkg. --print-architecture)" |
| 33 | if [scip-shell system . . `[`. -n "${_ARCH}" ]; then |
| 34 | printfscip-shell system . . printf. "@@if not defined ARCH\\n" |
| 35 | printfscip-shell system . . printf. "@@define ARCH %s\\n" "${_ARCH}" |
| 36 | printfscip-shell system . . printf. "@@endif\\n" |
| 37 | fi |
| 38 | if [scip-shell system . . `[`. "${_ARCH}" = "amd64" ]; then |
| 39 | if [scip-shell system . . `[`. -e /sys/firmware/efiscip-shell filesystem . . `/sys/firmware/efi`. ]; then |
| 40 | printfscip-shell system . . printf. "@@if not defined AMD64_FIRMWARE_EFI\\n" |
| 41 | printfscip-shell system . . printf. "@@define AMD64_FIRMWARE_EFI 1\\n" |
| 42 | printfscip-shell system . . printf. "@@endif\\n" |
| 43 | else |
| 44 | printfscip-shell system . . printf. "@@if not defined AMD64_FIRMWARE_BIOS\\n" |
| 45 | printfscip-shell system . . printf. "@@define AMD64_FIRMWARE_BIOS 1\\n" |
| 46 | printfscip-shell system . . printf. "@@endif\\n" |
| 47 | fi |
| 48 | fi |
| 49 | if [scip-shell system . . `[`. -n "$(dpkgscip-shell system . . dpkg. --print-foreign-architectures)" ]; then |
| 50 | if [scip-shell system . . `[`. "$(dpkgscip-shell system . . dpkg. --print-foreign-architectures | wcscip-shell system . . wc. -l)" -gt 1 ]; then |
| 51 | printfscip-shell system . . printf. "@@if not defined FOREIGN_ARCHES\\n" |
| 52 | printfscip-shell system . . printf. "@@define FOREIGN_ARCHES %s\\n" "$(dpkgscip-shell system . . dpkg. --print-foreign-architectures | trscip-shell system . . tr. '\\n' '|' | sedscip-shell system . . sed. 's/^/(/; s/|$/)/')" |
| 53 | printfscip-shell system . . printf. "@@endif\\n" |
| 54 | else |
| 55 | printfscip-shell system . . printf. "@@if not defined FOREIGN_ARCHES\\n" |
| 56 | printfscip-shell system . . printf. "@@define FOREIGN_ARCHES %s\\n" "$(dpkgscip-shell system . . dpkg. --print-foreign-architectures)" |
| 57 | printfscip-shell system . . printf. "@@endif\\n" |
| 58 | fi |
| 59 | fi |
| 60 | |
| 61 | unset _HOST _FQDN _DNSDN _ARCH |
| 62 | |
| 63 | # vim:tabstop=2:expandtab:shiftwidth=2 |