From ca2bf3eba1b8d46cc561171060cbc90f6317c57d Mon Sep 17 00:00:00 2001 From: trotFunky Date: Tue, 21 Nov 2017 23:23:43 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20quoi=20g=C3=A9rer=20l'appel=20au?= =?UTF-8?q?=20script=20depuis=20n'importe=20o=C3=B9=20de=20mani=C3=A8re=20?= =?UTF-8?q?contr=C3=B4l=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Perso/package_save.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Perso/package_save.sh b/Perso/package_save.sh index edacc48..aadb344 100755 --- a/Perso/package_save.sh +++ b/Perso/package_save.sh @@ -1,12 +1,21 @@ #! /bin/bash -if [ $# -eq 0 ]; then - name=packages_state -else - name=$1 +name=packages_state +location="$HOME/SYS_SAVES/" + +if [ $# -ne 0 ]; then + if [ ! -z "$1" -a "$1" != "here" ]; then + name=$1 + fi + if [ "$2" = here -o "$1" = here ]; then + location="." + elif [ ! -z "$2" ]; then + echo "Second argument can be void or 'here' only" + exit + fi fi - +cd $location pathName="$name""_$(date +'%Y-%m-%d @ %Hh%M')" mkdir "$pathName"