From 31a5155f78385f67420ab60f8feafdeb1d06461f Mon Sep 17 00:00:00 2001 From: trotFunky Date: Sun, 19 Nov 2017 15:22:42 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9placemets=20des=20scripts=20en=20dossier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perso: -Script de sauvegarde des paquets [Anciennement dossier TSP] --- Perso/package_save.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 Perso/package_save.sh diff --git a/Perso/package_save.sh b/Perso/package_save.sh new file mode 100755 index 0000000..856e69a --- /dev/null +++ b/Perso/package_save.sh @@ -0,0 +1,33 @@ +#! /bin/bash + +if [ $# -eq 0 ]; then + name=packages_state +else + name=$1 +fi + + +pathName="$name""_$(date +'%Y-%m-%d @ %Hh%M')" + +mkdir "$pathName" +cd "./$pathName" +mkdir "./preferences.d" + +cp /etc/apt/sources.list . +cp /etc/apt/preferences.d/my_preferences ./preferences.d/ + +sudo dpkg --get-selections > "manual_package_save" + +a=TEM.sh + +echo "#! /bin/bash" > $a +echo "" >> $a +echo "cd .." >> $a +echo "rm -r \"$pathName\"" >> $a + +chmod u+x "$a" + +cd - + +exit +