You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
2.0 KiB
47 lines
2.0 KiB
#!/bin/bash
|
|
#
|
|
# Initial script for Live operating system
|
|
# This script are launching before starting init from linux-live script.
|
|
# Current dir allways must be set to root (/)
|
|
# All system path must be relative, except initrd dirs
|
|
|
|
ENABLED=yes
|
|
[[ ${ENABLED} == "yes" ]] || exit 0
|
|
DEBUGMODE=no
|
|
|
|
PATH=.:/:/usr/bin:/usr/local/bin:/usr/local/sbin
|
|
unset ROOTFS; [[ -d /usr/lib/ublinux ]] || ROOTFS=.
|
|
|
|
SOURCE=${ROOTFS}/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
|
|
SOURCE=${ROOTFS}/usr/lib/ublinux/os-config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
|
|
debug_mode "$0" "$@"
|
|
|
|
SYSCONF="${ROOTFS}/${SYSCONF}"
|
|
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
|
|
SOURCE=${SYSCONF}/network; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
|
|
|
|
# [[ -z ${KERBEROS_REALM} ]] && KERBEROS_REALM=${DOMAIN^^}
|
|
# [[ -z ${SAMBADOMAIN} ]] && SAMBADOMAIN=$(echo ${KERBEROS_REALM} | awk -F . '{print $1}')
|
|
|
|
# sed -i s/kerberos.ublinux.ru/$ADSERVER/ etc/krb5.conf
|
|
# sed -i s/LOCAL.UBLINUX.RU/$KERBEROS_REALM/ etc/krb5.conf
|
|
# sed -i s/local.ublinux.ru/$DOMAIN/ etc/krb5.conf
|
|
#
|
|
# sed -i '/realm =/d' etc/samba/smb.conf
|
|
# sed -i '/security =/d' etc/samba/smb.conf
|
|
# sed -i '/password server =/d' etc/samba/smb.conf
|
|
# sed -i '/\[global\]/ s/$/'"\n realm = ${KERBEROS_REALM}\n security = ADS\n password server = ${ADSERVER}"/ etc/samba/smb.conf
|
|
#
|
|
#
|
|
|
|
#if [[ -n "${SAMBADOMAIN}" ]]; then
|
|
# sed -i s/"workgroup = .*"/"workgroup = ${SAMBADOMAIN}"/ etc/samba/smb.conf
|
|
# sed -i s/"^NT_DOMAIN=.*"/"NT_DOMAIN=${SAMBADOMAIN}"/ etc/ntlmaps.cfg
|
|
#fi
|
|
if [[ -n ${DOMAIN} && ${DOMAIN[client]} == "realmd_sssd" ]]; then
|
|
if [[ -f ${ROOTFS}/etc/krb5.keytab ]]; then
|
|
[[ -f etc/krb5.conf && -f sssd/sssd.conf ]] || chroot . usr/bin/ubdomain-client -q configure 2>/dev/null
|
|
[[ -f ${ROOTFS}/usr/lib/systemd/system/sssd.service ]] && ln -sf /usr/lib/systemd/system/sssd.service ${ROOTFS}/etc/systemd/system/multi-user.target.wants/sssd.service
|
|
fi
|
|
fi
|