Files
system_update/templates/custom/sharing.sh.tpl
T
gilles 3b16fdd52a feat(post-install): catalogue de profils — paquets, Docker officiel, partages, VM tools (tâche 2 SJ-9)
- mécanisme presetVars (variables fixes injectées au rendu, surchargées par le formulaire)
- 6 profils : base_tools / network_tools / dev_git (listes de paquets, low),
  docker_official (dépôt officiel Debian, confirmation), sharing (Samba/NFS/mDNS, confirmation),
  vm_guest_tools (qemu/vmware)
- 4 templates custom (install-package-groups, docker-official-debian, sharing, vm-guest-tools)
  émettant PKG_INSTALLED/SERVICE_ENABLED/ERR → réutilise buildPostInstallResult
- l'UI post-install générique les expose automatiquement (manifeste → formulaire → run)

tsc 0 · 104 tests · build OK · boot OK (8 profils servis). Clôt le volet moteur tâche 2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 12:40:20 +02:00

27 lines
891 B
Smarty

#!/bin/sh
# Partage réseau : installe les paquets cochés (Samba/NFS/mDNS). Config détaillée = tâche 4.
export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive
echo "===SU:CUSTOM_SHARING==="
PKGS=""
{{#installSamba}}PKGS="$PKGS samba"{{/installSamba}}
{{#installNfs}}PKGS="$PKGS nfs-kernel-server"{{/installNfs}}
{{#installMdns}}PKGS="$PKGS avahi-daemon libnss-mdns"{{/installMdns}}
if [ -z "$PKGS" ]; then
echo "ERR=no_sharing_selected"
echo "===SU:EXIT=2==="
exit 2
fi
apt-get update -qq 2>&1
if apt-get install -y $PKGS 2>&1; then
for p in $PKGS; do echo "PKG_INSTALLED=$p"; done
{{#installSamba}}echo "SERVICE_ENABLED=smbd"{{/installSamba}}
{{#installNfs}}echo "SERVICE_ENABLED=nfs-kernel-server"{{/installNfs}}
{{#installMdns}}echo "SERVICE_ENABLED=avahi-daemon"{{/installMdns}}
CODE=0
else
echo "ERR=sharing_install_failed"
CODE=1
fi
echo "===SU:EXIT=${CODE}==="