diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-14 13:10:23 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-14 13:10:23 +0100 |
commit | c9dc9785ce8632ededd7caaab5fd9c540c58d5f7 (patch) | |
tree | 5ead629517a0c6f538742afa3ee00171e8f9c5ba | |
parent | cab25b6b3e9f5d103b59941e1f897a78a9713dfb (diff) | |
download | itzks-systems-c9dc9785ce8632ededd7caaab5fd9c540c58d5f7.tar.gz itzks-systems-c9dc9785ce8632ededd7caaab5fd9c540c58d5f7.tar.bz2 itzks-systems-c9dc9785ce8632ededd7caaab5fd9c540c58d5f7.zip |
sbin/itzks-update-disklserver-squashfs-images: Add magic to configure an X2Go TCE.
-rwxr-xr-x | sbin/itzks-update-disklserver-squashfs-images | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sbin/itzks-update-disklserver-squashfs-images b/sbin/itzks-update-disklserver-squashfs-images index 1514618..dd686ff 100755 --- a/sbin/itzks-update-disklserver-squashfs-images +++ b/sbin/itzks-update-disklserver-squashfs-images @@ -34,6 +34,7 @@ mkdir -p ${TMPDIR}/ chown root:root ${TMPDIR} chmod 1777 ${TMPDIR} +# Prep LTSP configuration if [ -e "/etc/ltsp/ltsp.conf.itzks-systems-disklserver.in" ] && cat "/etc/ltsp/ltsp.conf.itzks-systems-disklserver.in" | grep -v "#" | grep -q "@rootpw@"; then # Drop previous ltsp.conf (yes, we want to do that!) @@ -51,6 +52,54 @@ if [ -e "/etc/ltsp/ltsp.conf.itzks-systems-disklserver.in" ] && cat "/etc/ltsp/l unset host_rootpw fi +# Prep X2Go configuration (and pre the chroot, as well) +if [ -e "/etc/ltsp/x2gothinclient-settings.conf" ]; then + . "/etc/ltsp/x2gothinclient-settings.conf" + + # FIXME: check for more than one chroot... + TC_FLAVOUR="${TC_FLAVOUR:-minidesktop}" + TC_DISTRO_CODENAME="${TC_DISTRO_CODENAME:-bullseye}" + TC_DISTRO_ARCH="${TC_DISTRO_ARCH:-amd64}" + TC_CHROOT="${TC_CHROOT:-/srv/ltsp/x2go-${TC_FLAVOUR}+${TC_DISTRO_ARCH}+${TC_DISTRO_CODENAME}}" + TC_CONFIG="${TC_CONFIG:-/etc/ltsp/settings_x2go-${TC_FLAVOUR}+${TC_DISTRO_ARCH}+${TC_DISTRO_CODENAME}}" + + if [ -e "${TC_CHROOT}" ]; then + + echo "Installing X2Go TCE configuration into chroot environment..." + + mkdir -p "$TC_CHROOT/etc/x2go/" + + ls "$TC_CONFIG/x2gothinclient_init.d/" | while read init_part; do + mkdir -p "$TC_CHROOT/etc/x2go/x2gothinclient_init.d/" + if test -f "$TC_CONFIG/x2gothinclient_init.d/$init_part"; then + cp -v "$TC_CONFIG/x2gothinclient_init.d/$init_part" "$TC_CHROOT/etc/x2go/x2gothinclient_init.d/" + chmod a+rx "$TC_CHROOT/etc/x2go/x2gothinclient_init.d/$init_part" + fi + done + + if test -f "$TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_start"; then + cp -v "$TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_start" "$TC_CHROOT/etc/x2go/x2gothinclient-${TC_FLAVOUR}_start" + chmod a+rx "$TC_CHROOT/etc/x2go/x2gothinclient-${TC_FLAVOUR}_start" + fi + + if test -f "$TC_CONFIG/x2gothinclient_sessions"; then + cp -v "$TC_CONFIG/x2gothinclient_sessions" "$TC_CHROOT/etc/x2go/x2gothinclient_sessions" + chmod a+rx "$TC_CHROOT/etc/x2go/x2gothinclient_sessions" + fi + + if test -f "$TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_background.svg"; then + cp -v "$TC_CONFIG/x2gothinclient-${TC_FLAVOUR}_background.svg" "$TC_CHROOT/etc/x2go/x2gothinclient-${TC_FLAVOUR}_background.svg" + ln -sf "/etc/x2go/x2gothinclient-${TC_FLAVOUR}_background.svg" "$TC_CHROOT/etc/x2go/x2gothinclient-background.svg" + fi + + if test -f "$TC_CONFIG/freerdp/known_hosts" || test -f "$TC_CONFIG/freerdp/known_hosts2" ; then + mkdir -p "$TC_CHROOT/etc/x2go/freerdp/" + cp -v "$TC_CONFIG"/freerdp/known_hosts* "$TC_CHROOT/etc/x2go/freerdp/" + fi + fi +fi + +# update (rebuild) squashfs images ltsp_chroots="$(ls "${LTSP_OPT}" | while read chroot_dir; do test ! -h "${LTSP_OPT}/${chroot_dir}" -a -x "${LTSP_OPT}/${chroot_dir}/bin/bash" && echo -n "${chroot_dir} " || true; done)" ltsp_chroots="${ltsp_chroots%%?*( )}" |