feat: templates shell APT + rendu Mustache
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Rendu sans sudo: le script entier est exécuté sous sudo par la couche SSH.
|
||||
export LC_ALL=C
|
||||
{{#aptProxy}}export http_proxy="{{aptProxy}}"; export https_proxy="{{aptProxy}}"
|
||||
{{/aptProxy}}
|
||||
echo "===SU:UPDATE==="
|
||||
apt-get update -qq 2>&1
|
||||
echo "===SU:SIMULATE==="
|
||||
apt-get -s -y full-upgrade 2>&1
|
||||
echo "===SU:REBOOT==="
|
||||
if [ -f /var/run/reboot-required ]; then echo "REBOOT_REQUIRED=1"; else echo "REBOOT_REQUIRED=0"; fi
|
||||
echo "===SU:END==="
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
export LC_ALL=C
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
{{#aptProxy}}export http_proxy="{{aptProxy}}"; export https_proxy="{{aptProxy}}"
|
||||
{{/aptProxy}}
|
||||
echo "===SU:UPGRADE==="
|
||||
apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold full-upgrade 2>&1
|
||||
CODE=$?
|
||||
echo "===SU:REBOOT==="
|
||||
if [ -f /var/run/reboot-required ]; then echo "REBOOT_REQUIRED=1"; else echo "REBOOT_REQUIRED=0"; fi
|
||||
echo "===SU:EXIT=${CODE}==="
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
export LC_ALL=C
|
||||
echo "===SU:REBOOT_NOW==="
|
||||
# Reboot différé pour laisser le canal SSH se fermer proprement.
|
||||
nohup sh -c 'sleep 2; reboot' >/dev/null 2>&1 &
|
||||
echo "reboot planifié"
|
||||
Reference in New Issue
Block a user