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"