diff options
author | simona | 2018-11-28 23:02:28 +0100 |
---|---|---|
committer | simona | 2018-11-28 23:02:28 +0100 |
commit | d23e0283243aa47a4fd46d625be4e55e4d41ec5f (patch) | |
tree | 73a134ebb3a6ba86cb1f8c37e3db6bdba01e17c6 | |
parent | 72b58b43eb3b020d33ff4ee98c005d8aef58cf0e (diff) | |
download | aur-d23e0283243aa47a4fd46d625be4e55e4d41ec5f.tar.gz |
fixes
-rw-r--r-- | .SRCINFO | 6 | ||||
-rwxr-xr-x | PKGBUILD | 6 | ||||
-rwxr-xr-x | macinstall | 63 | ||||
-rwxr-xr-x | simona-scripts | 2 |
4 files changed, 60 insertions, 17 deletions
@@ -1,6 +1,6 @@ pkgbase = simonascripts pkgdesc = Bash unique command for mount image files (iso, vms, crypto, squashfs), detect pendrive device name, list all kernels, list all i/o schedulers, copy install files. - pkgver = 0.0.13 + pkgver = 0.0.14 pkgrel = 1 changelog = simonascripts.changelog arch = any @@ -33,9 +33,9 @@ pkgbase = simonascripts md5sums = 861389b38ba1cd9e6bcc47b6c469e383 md5sums = c58f5737bb41c8af2bff7dd24a3d2723 md5sums = 40ef9e0d1831cc1865208bf52eaa2cef - md5sums = 7229088fedb8b7a65737f6248da1c651 + md5sums = 331e7dbdd1adbed7beaad5975a368d91 md5sums = 3189eb5ae50a9ddce43c8820c35ba2b0 - md5sums = 976ebf2c0ee09b254263077b6edd5f85 + md5sums = bc20a49e5498bd02c9bf6e126db8ca74 md5sums = 895210bbf0e6c16c6df7437eb3489ac1 md5sums = 7e4b85c6508890c6f5c88b3d886206a6 @@ -1,6 +1,6 @@ # Maintainer: Simona <simona.pisano[at]gmail[dot]com> pkgname=simonascripts -pkgver=0.0.13 +pkgver=0.0.14 pkgrel=1 pkgdesc="Bash unique command for mount image files (iso, vms, crypto, squashfs), detect pendrive device name, list all kernels, list all i/o schedulers, copy install files." @@ -38,9 +38,9 @@ md5sums=('3f5599c3588f01b625aa9feb0a0e8b99' '861389b38ba1cd9e6bcc47b6c469e383' 'c58f5737bb41c8af2bff7dd24a3d2723' '40ef9e0d1831cc1865208bf52eaa2cef' - '7229088fedb8b7a65737f6248da1c651' + '331e7dbdd1adbed7beaad5975a368d91' '3189eb5ae50a9ddce43c8820c35ba2b0' - '976ebf2c0ee09b254263077b6edd5f85' + 'bc20a49e5498bd02c9bf6e126db8ca74' '895210bbf0e6c16c6df7437eb3489ac1' '7e4b85c6508890c6f5c88b3d886206a6') diff --git a/macinstall b/macinstall index 7658418a5415..ba1ddb34fec1 100755 --- a/macinstall +++ b/macinstall @@ -3,7 +3,9 @@ # simona-scripts # Libertamente utilizzabile sotto GPL v3 -if [[ $1 == "-h" || $1 == "--help" || $1 == "list" || $1 == "" ]] ; then + +if [[ $1 == "-h" || $1 == "--help" ]] ; then + cat << EOF macinstall command help @@ -13,7 +15,7 @@ Directory /etc/macinstall.d contains all alternative install files related. Usage macinstall [--help|-h] macinstall [--version] - macinstall [name-install] + macinstall name-install [local-import] Optional parameters @@ -23,23 +25,43 @@ Optional parameters ---this-is-not-an-exercise -> force real work without this none i really done. this is a secure check. Required - sed + sed sudo Cfg file /etc/macinstall.d/macinstall.conf Propname (wold before '=' char) can't contain spaces but file name accept '"' and delimiter and single '\' (before space) EOF - exit + + exit 0 elseif [[ $1 == "--version" ]] echo "macinstall Version 0.0" - exit + exit 0 fi +# +## who am I +# +path_prefix_system_semaphore="/etc/macinstall.d/CurrentSystem-" +#path_prefix_system_semaphore="/home/simona/My Work/my-pkg simonascripts/root-test/etc/CurrentSystem-" + +numSem=`ls "$path_prefix_system_semaphore"* 2> /dev/null | wc -l` +case $numSem in + 1) currSystem=`ls -1 "$path_prefix_system_semaphore"* 2> /dev/null` + currSystem="${currSystem:${#path_prefix_system_semaphore}:${#currSystem}-${#path_prefix_system_semaphore}}" + echo "I am $currSystem" + ;; + 0) echo "Can't detect current system." + ;; + *) echo "Ambiguous CurrentSystem ($numSem)!!!" + ;; +esac + [[ ! -r /bin/sed ]] && { echo -e "$ERR Missing sed utility! Exit"; exit 1; } [[ ! -r /bin/sudo ]] && { echo -e "$ERR Missing sudo utility! Exit"; exit 1; } -[[ $1 != "" ]] && install_macname=$1 || { echo "Please insert install name as first command parameter!!"; exit 0; } +[[ $1 != "" ]] && install_macname=$1 || exit 0 +#[[ $1 != "" ]] && install_macname=$1 || { echo "Please insert install name as first command parameter!!"; exit 0; } runLocalImport=false [[ $2 == "local-import" ]] && runLocalImport=true @@ -71,16 +93,23 @@ WARN="\E[33;40m[WARN]${EchoReset}" ERR="\E[31;40m[ERR]${EchoReset}" #echo -e "$OK $WARN $ERR" +#path_cfg must be '/' terminated #path_cfg="../etc-macinstall.d/" path_cfg="/etc/macinstall.d/" +#if last char is not '/' add it +[[ ${path_cfg:${#path_cfg}-1:1} != "/" ]] && path_cfg="$path_cfg/" + + filename_cfg="macinstall.conf" -path_dest="/home/simona/My Work/my-pkg simonascripts/root-test/" -#path_dest="$HOME/test" +#path_dest must be '/' terminated +#path_dest="/home/simona/My Work/my-pkg simonascripts/root-test/" +path_dest="$HOME/test/" #path_dest="/" +#if last char is not '/' add it +[[ ${path_dest:${#path_dest}-1:1} != "/" ]] && path_dest="$path_dest/" + -#path_prefix_system_semaphore="/etc/CurrentSystem-" -path_prefix_system_semaphore="/home/simona/My Work/my-pkg simonascripts/root-test/etc/CurrentSystem-" postfix_bak_file_name=".bak" @@ -100,6 +129,7 @@ if [[ ! -r $path_cfg$filename_cfg ]] ; then touch $path_cfg$filename_cfg [[ $? -ne 0 ]] && { echo -e "$ERR Fail '$path_cfg$filename_cfg' touch cmd creation !!"; exit 1; } fi + if [[ ! -d $path_dest ]] ; then mkdir -p $path_dest [[ $? -ne 0 ]] && { echo -e "$ERR Fail $path_dest mkdir cmd creation !!"; exit 1; } @@ -166,6 +196,7 @@ if [[ $number_directories -gt 0 ]] ; then done fi + # ------------------------------------------------------------------------------------------------------------------------ # WORK ------------------------------------------------------------------------------------------------------------------- # ------------------------------------------------------------------------------------------------------------------------ @@ -181,7 +212,17 @@ fi #legge macchina corrente su file semaforo, legge macchina corrente da parametro (devono corrispondere) # e va ricopiarsi tutti i files elencati sulla macchina (se presente) nella cartella giusta (รจ un fresh dei files di install) if [[ $runLocalImport == true ]] ; then - echo "TO-DO" + + #if current install exist but it is not the one current i can't proceede + numSem=$(ls "$path_prefix_system_semaphore"* 2> /dev/null | wc -l) + if [[ numSem -gt 0 ]] ; then + if [[ ! -r "$path_prefix_system_semaphore$install_macname" ]] ; then + echo -e "$ERR Another install. Can't work" + exit 1 + fi + fi + + # exit 0 fi diff --git a/simona-scripts b/simona-scripts index 99618aa1b194..ef716c7f6485 100755 --- a/simona-scripts +++ b/simona-scripts @@ -4,6 +4,7 @@ # Libertamente utilizzabile sotto GPL v3 if [[ $1 == "-h" || $1 == "--help" || $1 == "list" || $1 == "" ]] ; then + cat << EOF simona-scripts - GPL v3 license image-mount - image - mount a big amount of image file (use -h for a full list) @@ -14,6 +15,7 @@ boot-kernel-list - boot - list kernels inside /boot, extract version (lile uuid-change - uuid - change uuid of a volume macinstall - install id files (commanded by config file) EOF + exit elseif [[ $1 == "--version" ]] echo "simona-scripts Version 0.0" |