Ajout de quoi gérer l'appel au script depuis n'importe où de manière contrôlée
This commit is contained in:
parent
46c6dfc830
commit
ca2bf3eba1
1 changed files with 14 additions and 5 deletions
|
@ -1,12 +1,21 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
name=packages_state
|
||||||
name=packages_state
|
location="$HOME/SYS_SAVES/"
|
||||||
else
|
|
||||||
|
if [ $# -ne 0 ]; then
|
||||||
|
if [ ! -z "$1" -a "$1" != "here" ]; then
|
||||||
name=$1
|
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
|
fi
|
||||||
|
|
||||||
|
cd $location
|
||||||
pathName="$name""_$(date +'%Y-%m-%d @ %Hh%M')"
|
pathName="$name""_$(date +'%Y-%m-%d @ %Hh%M')"
|
||||||
|
|
||||||
mkdir "$pathName"
|
mkdir "$pathName"
|
||||||
|
|
Loading…
Add table
Reference in a new issue