Files
pxe_boot_alma/work/KickStart/cfg/ksid.py-bak
T
andersenandClaude Fable 5 6d398b826a refactor: move tree under homelab/, add alma10 hardening and kickstart docs
- restructure boot/kickstarts/scripts/docs into homelab/
- docs: alma9->10 breaking changes, CIS hardening, kickstart changes
- add find_cron_entries.sh helper and codex running memory notes

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-06 22:35:07 -04:00

55 lines
1.3 KiB
Python

#!/usr/bin/python
import re
import os
import sys
log = 0
try:
# See if we are running in KickStart for logging
sys.path.append("/usr/lib/anaconda")
import anaconda_log
import logging
log = logging.getLogger("anaconda")
from anaconda_log import logger, logLevelMap
logger.addSysLogHandler(log, "10.1.1.1")
except:
pass
streg = re.compile('^\s+Serial Number:\s+(.+)$')
pnreg = re.compile('^\s+Product Name:\s+(.+)$')
addrreg = re.compile('^\s+inet addr:\s*(\S+)\s+.+$')
localreg = re.compile('^127\..+$')
st = ""
pn = ""
ips = []
if os.geteuid() == 0:
try:
for line in os.popen("/usr/sbin/dmidecode").readlines():
if streg.match(line) and st == '':
st = streg.match(line).group(1).strip()
if pnreg.match(line) and pn == '':
pn = pnreg.match(line).group(1).strip()
except:
print "# Problem running dmidecode"
else:
print "# Must be root to run deidecode"
try:
for line in os.popen("ifconfig").readlines():
if addrreg.match(line) and not localreg.match(addrreg.match(line).group(1)):
ips = ips + [ addrreg.match(line).group(1) ]
except:
print "# Problem running ifconfig"
if st == '':
msg = "Starting pre-KickStart for %s" % (ips)
else:
msg = "Starting pre-KickStart for %s (%s) %s" % (st, pn, ips)
print "# ", msg
if log: log.info(msg)