From 5391bad113dbf3e5dc2cc69e2735be6ff70ac3b4 Mon Sep 17 00:00:00 2001 From: "Daniel P. Clark" <6ftdan@gmail.com> Date: Tue, 9 Jan 2018 05:14:59 -0500 Subject: [PATCH] Add manpage during installation --- install.sh | 88 +++++++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/install.sh b/install.sh index 748bd02..3ea0e46 100755 --- a/install.sh +++ b/install.sh @@ -3,60 +3,66 @@ # Checking if Rust is installed if [ `which rustc` ]; then - # Rust is installed - echo "Rust already installed" + # Rust is installed + echo "Rust already installed" else - # Rust is not installed - # Ask for user consent before proceeding with installation - read -p "Rust is not installed. Do you want to install Rust now ? (necessary for Abrute) [y/n] " Rust_answer - - if [ "$Rust_answer" == "y" ]; - then - # User agreed, proceed with installation - curl https://sh.rustup.rs -sSf | sh -s -- --channel=nightly - else - # User refused, abort installation - exit 1 - fi + # Rust is not installed + # Ask for user consent before proceeding with installation + read -p "Rust is not installed. Do you want to install Rust now ? (necessary for Abrute) [y/n] " Rust_answer + + if [ "$Rust_answer" == "y" ]; + then + # User agreed, proceed with installation + curl https://sh.rustup.rs -sSf | sh -s -- --channel=nightly + else + # User refused, abort installation + exit 1 + fi fi # Checking if Aescrypt is installed if [ -f /usr/bin/aescrypt ] && [ -f /usr/bin/aescrypt_keygen ]; then - # Aescrypt is already installed - echo "Aescrypt already installed" + # Aescrypt is already installed + echo "Aescrypt already installed" else - # Aescrypt is not installed, proceed with installation - echo "Installing Aescrypt" - wget https://www.aescrypt.com/download/v3/linux/aescrypt-3.13.tgz - tar -xzf aescrypt-3.13.tgz - cd aescrypt-3.13/src - make && sudo make install - cd ../.. && rm -rf aescrypt-3.13 && rm aescrypt-3.13.tgz - echo "Aescrypt installed" + # Aescrypt is not installed, proceed with installation + echo "Installing Aescrypt" + wget https://www.aescrypt.com/download/v3/linux/aescrypt-3.13.tgz + tar -xzf aescrypt-3.13.tgz + cd aescrypt-3.13/src + make && sudo make install + cd ../.. && rm -rf aescrypt-3.13 && rm aescrypt-3.13.tgz + echo "Aescrypt installed" fi # Checking for the existence of source files if [ -d src ] && [ -d .git ]; then - # The source files are already there. We can build and install Abrute. - cargo +nightly build --release - sudo cp target/release/abrute /usr/bin + # The source files are already there. We can build and install Abrute. + cargo +nightly build --release + sudo cp target/release/abrute /usr/bin + + if [ -d /usr/local/share/man/man1 ]; + then + sudo cp abrute.1 /usr/local/share/man/man1/ + sudo mandb -pq + fi else - # Downloading the source files - wget https://github.com/danielpclark/abrute/archive/master.zip - unzip master.zip - cd abrute-master - - # Building and installing - bash -lc "cargo +nightly build --release" - sudo cp target/release/abrute /usr/bin - - # Cleaning - cd .. - rm master.zip - rm -r abrute-master/ + # Downloading the source files + wget https://github.com/danielpclark/abrute/archive/master.zip + unzip master.zip + cd abrute-master + + # Building and installing + bash -lc "cargo +nightly build --release" + sudo cp target/release/abrute /usr/bin + + # Cleaning + cd .. + rm master.zip + rm -r abrute-master/ fi -echo "Thank you for installing Abrute. Enjoy !" +echo "Thank you for installing Abrute. Enjoy!"