summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimona2018-11-29 05:09:42 +0100
committersimona2018-11-29 05:09:42 +0100
commit4ef454ee2f5ec82cd73cac46cfb920cf5720f2ea (patch)
treee178353193a6c22fd93b1803986f0fc663ec2547
parentd23e0283243aa47a4fd46d625be4e55e4d41ec5f (diff)
downloadaur-4ef454ee2f5ec82cd73cac46cfb920cf5720f2ea.tar.gz
macinstall man
-rw-r--r--.SRCINFO6
-rwxr-xr-xPKGBUILD12
-rwxr-xr-xmacinstall123
-rw-r--r--macinstall.1112
4 files changed, 217 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 01d83ca0f91e..f7a9e9804167 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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.14
+ pkgver = 0.0.15
pkgrel = 1
changelog = simonascripts.changelog
arch = any
@@ -28,6 +28,7 @@ pkgbase = simonascripts
source = macinstall
source = macinstall.conf
source = image-mount.1
+ source = macinstall.1
md5sums = 3f5599c3588f01b625aa9feb0a0e8b99
md5sums = a66639338ea804997cc38af80d9249ea
md5sums = 861389b38ba1cd9e6bcc47b6c469e383
@@ -35,9 +36,10 @@ pkgbase = simonascripts
md5sums = 40ef9e0d1831cc1865208bf52eaa2cef
md5sums = 331e7dbdd1adbed7beaad5975a368d91
md5sums = 3189eb5ae50a9ddce43c8820c35ba2b0
- md5sums = bc20a49e5498bd02c9bf6e126db8ca74
+ md5sums = 0da0f06f52839ae85aa79d3e2a2bd069
md5sums = 895210bbf0e6c16c6df7437eb3489ac1
md5sums = 7e4b85c6508890c6f5c88b3d886206a6
+ md5sums = b43048da4fc73e25202f2c12c4732259
pkgname = simonascripts
diff --git a/PKGBUILD b/PKGBUILD
index 8190b7df2817..9517344c14a4 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Simona <simona.pisano[at]gmail[dot]com>
pkgname=simonascripts
-pkgver=0.0.14
+pkgver=0.0.15
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."
@@ -31,7 +31,8 @@ source=( "boot-kernel-list"
"uuid-change"
"macinstall"
"macinstall.conf"
- "image-mount.1" )
+ "image-mount.1"
+ "macinstall.1" )
md5sums=('3f5599c3588f01b625aa9feb0a0e8b99'
'a66639338ea804997cc38af80d9249ea'
@@ -40,9 +41,10 @@ md5sums=('3f5599c3588f01b625aa9feb0a0e8b99'
'40ef9e0d1831cc1865208bf52eaa2cef'
'331e7dbdd1adbed7beaad5975a368d91'
'3189eb5ae50a9ddce43c8820c35ba2b0'
- 'bc20a49e5498bd02c9bf6e126db8ca74'
+ '0da0f06f52839ae85aa79d3e2a2bd069'
'895210bbf0e6c16c6df7437eb3489ac1'
- '7e4b85c6508890c6f5c88b3d886206a6')
+ '7e4b85c6508890c6f5c88b3d886206a6'
+ 'b43048da4fc73e25202f2c12c4732259')
package() {
cd "$srcdir"
@@ -56,6 +58,8 @@ package() {
install -Dm 755 "$srcdir/macinstall" "$pkgdir/usr/bin/macinstall"
install -Dm 755 "$srcdir/macinstall.conf" "$pkgdir/etc/macinstall.d/macinstall.conf"
install -Dm 644 "$srcdir/image-mount.1" "$pkgdir/usr/share/man/man1/image-mount.1"
+ install -Dm 644 "$srcdir/macinstall.1" "$pkgdir/usr/share/man/man1/macinstall.1"
+
}
diff --git a/macinstall b/macinstall
index ba1ddb34fec1..f4f2bfc4cda6 100755
--- a/macinstall
+++ b/macinstall
@@ -9,27 +9,89 @@ if [[ $1 == "-h" || $1 == "--help" ]] ; then
cat << EOF
macinstall command help
-Use this command to change local installation.
-Directory /etc/macinstall.d contains all alternative install files related.
-
-Usage
- macinstall [--help|-h]
- macinstall [--version]
- macinstall name-install [local-import]
-
-
-Optional parameters
- --help -h -> this help page
- --versione -> version
- -y --ask-confirm -> ask confirm before proceeed
- ---this-is-not-an-exercise -> force real work without this none i really done. this is a secure check.
-
-Required
+Imagine you want install arch linux one time and that clone on all disk
+ad pc you have. But you should have some different file that differ from
+one installation to another. This command help you to manage this.
+
+Imagine you have your /etc/macinstall.d/yourpc* with all files/folder
+like:
+ /etc/macinstall.d/yourpc1/etc/fstab
+ /etc/macinstall.d/yourpc1/boot/grug/grub.cfg
+ /etc/macinstall.d/yourpc1/etc/machine-id
+ /etc/macinstall.d/yourpc1/etc/hostname
+ /etc/macinstall.d/yourpc1/etc/ssh/host_*
+ /etc/macinstall.d/yourpc1/..
+A second install like
+ /etc/macinstall.d/yourpc2/etc/fstab
+ /etc/macinstall.d/yourpc2/boot/grug/grub.cfg
+ /etc/macinstall.d/yourpc2/etc/machine-id
+ /etc/macinstall.d/yourpc2/etc/hostname
+ /etc/macinstall.d/yourpc2/etc/ssh/host_*
+ /etc/macinstall.d/yourpc2/etc/..
+A config file with sessione [yourpc1] and [yourpc2] (edit yourself
+macinstall.conf)
+ /etc/macinstall.d/macinstall.conf
+with:
+ [yourpc1]
+ CopyFilesNum=5
+ CopyFile1=/etc/fstab
+ CopyFile2=/boot/grub/grub.cfg
+ CopyFile3=/etc/grub.d/40_custom
+ CopyFile4=/etc/hostname
+ CopyFile5=/etc/machine-id
+ CopyDirectoriesNum=1
+ CopyDirectory1=/etc/ssh
+ WriteSemaphore=yes
+ AllowOnlyIfPreviousMacIs=yourpc2
+and
+ [yourpc2]
+ CopyFilesNum=5
+ CopyFile1=/etc/fstab
+ CopyFile2=/boot/grub/grub.cfg
+ CopyFile3=/etc/grub.d/40_custom
+ CopyFile4=/etc/hostname
+ CopyFile5=/etc/machine-id
+ CopyDirectoriesNum=1
+ CopyDirectory1=/etc/ssh
+ WriteSemaphore=yes
+ AllowOnlyIfPreviousMacIs=yourpc1
+And finally a command like to switch from one system to another
+ macinstall yourpc1 ---this-is-not-an-exercise
+ macinstall yourpc2 ---this-is-not-an-exercise
+And a semaphore file like
+ /etc/macinstall.d/CurrentSystem-yourpc1
+or
+ /etc/macinstall.d/CurrentSystem-yourpc2
+
+Summary usage
+ macinstall [-i --info none] [--help|-h] [--version] name-install
+ [local-import]
+
+Option parameters
+ --help -h -> this help page
+ -i --info or blank -> who am i looking semaphore file
+ --version -> version
+ -y --ask-confirm -> ask confirm before proceeed
+ ---this-is-not-an-exercise -> force real work. without this
+ none is really done. this is a
+ secure check.
+
+Path used
+ /etc/macinstall.d -> contains all single
+ install related files (example fstab grub.cfg machine-id...)
+ /usr/bin/macinstall -> this command itself
+ /etc/macinstall-d/CurrentSystem-pcname -> semaphore of installed
+ system (touch bank file)
+
+Example
+ A file /etc/macinstall.d/macinstall.conf with some demo config
+ is already supplyed.
+
+Packages required
sed sudo
-Cfg file
+Cfg file used
/etc/macinstall.d/macinstall.conf
-Propname (wold before '=' char) can't contain spaces but file name accept '"' and delimiter and single '\' (before space)
EOF
@@ -44,18 +106,19 @@ fi
#
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
+if [[ $1 == "" || $1 == "-i" || $1 == "--info" ]] ; then
+ 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
+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; }
diff --git a/macinstall.1 b/macinstall.1
new file mode 100644
index 000000000000..fcbdf0f1d115
--- /dev/null
+++ b/macinstall.1
@@ -0,0 +1,112 @@
+.\" Manpage for image-mount.
+.\" Contact Simona <simona.pisano[at]gmail[dot]com> to correct errors or typos.
+.TH man 1 "29 Nov 2018" "1.0" "macinstall man page"
+.SH NAME
+macinstall \- Bash script to manage different install files (if you clone smae install on more pcs)
+.SH SYNOPSIS
+macinstall macinstall [-i --info none] [--help|-h] [--version] name-install [local-import]
+.SH DESCRIPTION
+Bash script to manage different install files (if you clone smae install on more pcs)
+.SH OPTIONS
+--help, -h
+ this help page
+
+-i --info or blank
+ who am i looking semaphore file
+
+--version
+ version
+
+-y --ask-confirm
+ ask confirm before proceeed
+
+---this-is-not-an-exercise
+ force real work. without this none is really done. this is a secure check.
+
+-h, --help
+ display this help and exit
+
+--force-iso-stdmount
+ force in iso sudo mount 'mount -o loop' instead 'fuseiso'
+
+-y, --ask-confirm
+ confirm before execute
+
+--version
+ output version information and exit
+.SH PATH USED
+/etc/macinstall.d
+ contains all single install related files (example fstab grub.cfg machine-id...)
+
+/usr/bin/macinstall
+ this command itself
+
+/etc/macinstall-d/CurrentSystem-pcname
+ semaphore of installed system (touch bank file)
+
+.SH PACKAGE REQUIRED
+sed sudo
+
+.SH EXAMPLES
+Imagine you want install arch linux one time and that clone on all disk
+ad pc you have. But you should have some different file that differ from
+one installation to another. This command help you to manage this.
+
+Imagine you have your /etc/macinstall.d/yourpc* with all files/folder
+like:
+ /etc/macinstall.d/yourpc1/etc/fstab
+ /etc/macinstall.d/yourpc1/boot/grug/grub.cfg
+ /etc/macinstall.d/yourpc1/etc/machine-id
+ /etc/macinstall.d/yourpc1/etc/hostname
+ /etc/macinstall.d/yourpc1/etc/ssh/host_*
+ /etc/macinstall.d/yourpc1/..
+A second install like
+ /etc/macinstall.d/yourpc2/etc/fstab
+ /etc/macinstall.d/yourpc2/boot/grug/grub.cfg
+ /etc/macinstall.d/yourpc2/etc/machine-id
+ /etc/macinstall.d/yourpc2/etc/hostname
+ /etc/macinstall.d/yourpc2/etc/ssh/host_*
+ /etc/macinstall.d/yourpc2/etc/..
+A config file with sessione [yourpc1] and [yourpc2] (edit yourself
+macinstall.conf)
+ /etc/macinstall.d/macinstall.conf
+with:
+ [yourpc1]
+ CopyFilesNum=5
+ CopyFile1=/etc/fstab
+ CopyFile2=/boot/grub/grub.cfg
+ CopyFile3=/etc/grub.d/40_custom
+ CopyFile4=/etc/hostname
+ CopyFile5=/etc/machine-id
+ CopyDirectoriesNum=1
+ CopyDirectory1=/etc/ssh
+ WriteSemaphore=yes
+ AllowOnlyIfPreviousMacIs=yourpc2
+and
+ [yourpc2]
+ CopyFilesNum=5
+ CopyFile1=/etc/fstab
+ CopyFile2=/boot/grub/grub.cfg
+ CopyFile3=/etc/grub.d/40_custom
+ CopyFile4=/etc/hostname
+ CopyFile5=/etc/machine-id
+ CopyDirectoriesNum=1
+ CopyDirectory1=/etc/ssh
+ WriteSemaphore=yes
+ AllowOnlyIfPreviousMacIs=yourpc1
+And finally a command like to switch from one system to another
+ macinstall yourpc1 ---this-is-not-an-exercise
+ macinstall yourpc2 ---this-is-not-an-exercise
+And a semaphore file like
+ /etc/macinstall.d/CurrentSystem-yourpc1
+or
+ /etc/macinstall.d/CurrentSystem-yourpc2
+
+.SH SEE ALSO
+simona-scripts
+.SH BUGS
+No known bugs.
+.SH AUTHOR
+Simona Pisano (simona.pisano[at]gmail[dot]com)
+.SH COPYRIGHT
+Copyright © 2018 Simona Pisano. License GPLv3: GNU GPL version 3 <https://gnu.org/licenses/gpl.html>.