diff options
author | simona | 2018-11-28 21:29:07 +0100 |
---|---|---|
committer | simona | 2018-11-28 21:29:07 +0100 |
commit | 72b58b43eb3b020d33ff4ee98c005d8aef58cf0e (patch) | |
tree | c6055e989b0b6d357c9cefc4d6ebe7fd9bebce0d | |
parent | b75cb1e07ca13641fb09eb6d4cef6354b9c83f4b (diff) | |
download | aur-72b58b43eb3b020d33ff4ee98c005d8aef58cf0e.tar.gz |
macinstall fix
-rw-r--r-- | .SRCINFO | 4 | ||||
-rwxr-xr-x | PKGBUILD | 4 | ||||
-rwxr-xr-x | macinstall | 28 |
3 files changed, 26 insertions, 10 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.12 + pkgver = 0.0.13 pkgrel = 1 changelog = simonascripts.changelog arch = any @@ -35,7 +35,7 @@ pkgbase = simonascripts md5sums = 40ef9e0d1831cc1865208bf52eaa2cef md5sums = 7229088fedb8b7a65737f6248da1c651 md5sums = 3189eb5ae50a9ddce43c8820c35ba2b0 - md5sums = 4e970b1aa6ceb83547d4ff49773b1806 + md5sums = 976ebf2c0ee09b254263077b6edd5f85 md5sums = 895210bbf0e6c16c6df7437eb3489ac1 md5sums = 7e4b85c6508890c6f5c88b3d886206a6 @@ -1,6 +1,6 @@ # Maintainer: Simona <simona.pisano[at]gmail[dot]com> pkgname=simonascripts -pkgver=0.0.12 +pkgver=0.0.13 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." @@ -40,7 +40,7 @@ md5sums=('3f5599c3588f01b625aa9feb0a0e8b99' '40ef9e0d1831cc1865208bf52eaa2cef' '7229088fedb8b7a65737f6248da1c651' '3189eb5ae50a9ddce43c8820c35ba2b0' - '4e970b1aa6ceb83547d4ff49773b1806' + '976ebf2c0ee09b254263077b6edd5f85' '895210bbf0e6c16c6df7437eb3489ac1' '7e4b85c6508890c6f5c88b3d886206a6') diff --git a/macinstall b/macinstall index 3515501f65e2..7658418a5415 100755 --- a/macinstall +++ b/macinstall @@ -20,7 +20,7 @@ Optional parameters --help -h -> this help page --versione -> version -y --ask-confirm -> ask confirm before proceeed - ---this-is-not-an-exercise -> force real work + ---this-is-not-an-exercise -> force real work without this none i really done. this is a secure check. Required sed @@ -37,6 +37,7 @@ elseif [[ $1 == "--version" ]] fi [[ ! -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; } @@ -70,8 +71,8 @@ WARN="\E[33;40m[WARN]${EchoReset}" ERR="\E[31;40m[ERR]${EchoReset}" #echo -e "$OK $WARN $ERR" -path_cfg="../etc-macinstall.d/" -#path_cfg="/etc/macinstall.d/" +#path_cfg="../etc-macinstall.d/" +path_cfg="/etc/macinstall.d/" filename_cfg="macinstall.conf" path_dest="/home/simona/My Work/my-pkg simonascripts/root-test/" @@ -227,8 +228,11 @@ if [[ $number_files -gt 0 ]] ; then echo -e "$WARN Fail generating backup file '$path_dest$backup$postfix_bak_file_name'. Ask User." echo -n "Continue? (Y/N): "; read ask [[ ! $ask =~ ^(yes|y|YES|y|s|S|si|SI|sì)$ ]] && { echo "Exit forced by user with error."; exit 1; } + else + echo -e "$OK Generation of backup file [1] '$path_dest$backup' as '$path_dest$backup$postfix_bak_file_name'" fi - echo -e "$OK Generation of backup file '$path_dest$backup' as '$path_dest$backup$postfix_bak_file_name'" + else + echo -e "$OK Generation of backup file [2] '$path_dest$backup' as '$path_dest$backup$postfix_bak_file_name'" fi else echo -e "$OK [Simulated] Generation of backup file '$path_dest$backup' as '$path_dest$backup$postfix_bak_file_name'" @@ -243,8 +247,17 @@ if [[ $number_directories -gt 0 ]] ; then for (( counter=1; counter <= $number_directories; counter++ )) ; do backup=`sed -nr "/^\[$install_macname\]/ { :l /^$prop_cfg_dir_copy$counter[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $path_cfg$filename_cfg` [[ ${backup:0:1} == "/" ]] && backup=${backup:1:${#backup}-1} #remove starting '/' if exist - if [[ -d $path_dest$backup ]] ; then + if [[ -d "$path_dest$backup" ]] ; then if [[ "$flagForceRealWork" == true ]] ; then + #if bak directory alrrady exist to not create a new ssh dir inside it.... + if [[ -d "$path_dest$backup$postfix_bak_file_name" ]] ; then + rm -r -f "$path_dest$backup$postfix_bak_file_name" + if [[ $? -ne 0 ]] ; then + sudo rm -r -f "$path_dest$backup$postfix_bak_file_name" + [[ $? -ne 0 ]] && echo -e "$WARN Fail removing old backup directory.'$path_dest$backup$postfix_bak_file_name'." + fi + fi + #do work mv -f "$path_dest$backup" "$path_dest$backup$postfix_bak_file_name" if [[ $? -ne 0 ]] ; then sudo mv -f "$path_dest$backup" "$path_dest$backup$postfix_bak_file_name" @@ -252,8 +265,11 @@ if [[ $number_directories -gt 0 ]] ; then echo -e "$WARN Fail generating backup directory '$path_dest$backup$postfix_bak_file_name'. Ask User." echo -n "Continue? (Y/N): "; read ask [[ ! $ask =~ ^(yes|y|YES|y|s|S|si|SI|sì)$ ]] && { echo "Exit forced by user with error."; exit 1; } + else + echo -e "$OK Generation [1] of backup directory '$path_dest$backup$postfix_bak_file_name'" fi - echo -e "$OK Generation of backup directory '$path_dest$backup$postfix_bak_file_name'" + else + echo -e "$OK Generation [2] of backup directory '$path_dest$backup$postfix_bak_file_name'" fi else echo -e "$OK [Simulated] Generation of backup directory '$path_dest$backup$postfix_bak_file_name'" |