From 1aabc6637d6d3d5ced0e73634c9dead47a7f5b86 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 9 Apr 2016 02:26:54 +0200 Subject: [PATCH] Split Console Install Menu --- install/console/basic | 38 +++++++++++++++++++++ install/console/compression-tools | 25 ++++++++++++++ install/console/menu | 57 ++++++++----------------------- install/console/network-tools | 32 +++++++++++++++++ install/console/recovery-tools | 24 +++++++++++++ install/console/webbrowser | 24 +++++++++++++ install/menu | 2 +- 7 files changed, 159 insertions(+), 43 deletions(-) create mode 100644 install/console/basic create mode 100644 install/console/compression-tools create mode 100644 install/console/network-tools create mode 100644 install/console/recovery-tools create mode 100644 install/console/webbrowser diff --git a/install/console/basic b/install/console/basic new file mode 100644 index 0000000..bfe508f --- /dev/null +++ b/install/console/basic @@ -0,0 +1,38 @@ +#!/bin/bash +. ./lib + +options=() +options+=("bash-completion" "Best completion in bash" on) +options+=("lsof" "ls open file" on) +options+=("dmidecode" "Hardware infos" on) +options+=("nmon" "System monitor" on) +options+=("mc" "Dual pane file explorer" off) +options+=("powertop" "power mon and management" off) +options+=("dialog" "Dialog boxes for script" off) +options+=("gpm" "Console mouse support" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Console Basic packages :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"gpm"') + svcstart gpm + svcenable gpm + ;; + esac +done + +exit 0 diff --git a/install/console/compression-tools b/install/console/compression-tools new file mode 100644 index 0000000..7e2b9d2 --- /dev/null +++ b/install/console/compression-tools @@ -0,0 +1,25 @@ +#!/bin/bash +. ./lib + +options=() +options+=("zip" "ZIP files" on) +options+=("unzip" "ZIP files" on) +options+=("unrar" "RAR files" on) +options+=("p7zip" "File Archiver" on) + +sel=$(whiptail --backtitle "$apptitle" --title "Console Compression Tools :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/console/menu b/install/console/menu index b205a88..465a4df 100644 --- a/install/console/menu +++ b/install/console/menu @@ -2,54 +2,27 @@ . ./lib options=() -options+=("bash-completion" "Best completion in bash" on) -options+=("lsof" "ls open file" on) -options+=("dmidecode" "Hardware infos" on) -options+=("nmon" "System monitor" on) -options+=("rsync" "Sync files" on) -options+=("zip" "ZIP files" on) -options+=("unzip" "ZIP files" on) -options+=("unrar" "RAR files" on) -options+=("p7zip" "File Archiver" on) -options+=("traceroute" "Trace network route" on) -options+=("bind-tools" "DNS tools (nslookup)" on) -options+=("dnsutils" "DNS tools (nslookup)" off) -options+=("nmap" "Network scanner" off) -options+=("mc" "Dual pane file explorer" off) -options+=("links" "Web browser" off) -options+=("powertop" "power mon and management" off) -#options+=("gpm" "Console mouse support" off) -options+=("wavemon" "WIFI monitor" off) -options+=("speedtest-cli" "SpeedTest" off) -options+=("net-tools" "(deprecated) old ifconfig" off) -options+=("dialog" "Dialog boxes for script" off) -options+=("ddrescue" "HD recovery tool" off) -options+=("dd_rescue" "HD recovery tool" off) -options+=("partclone" "Copy used block on partition" off) +options+=("Basic" "") +options+=("Compression Tools" "") +options+=("Network Tools" "") +options+=("Webbrowser" "") +options+=("Recovery Tools" "") - -sel=$(whiptail --backtitle "$apptitle" --title "Console applications :" --checklist "" --cancel-button "Back" 0 0 0 \ +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ "${options[@]}" \ 3>&1 1>&2 2>&3) if [ ! "$?" = "0" ]; then exit 1 fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 -for itm in $sel; do - case $itm in - *) pkg="$pkg $(echo $itm | sed 's/"//g')";; - esac -done - -instpkg "$pkg" "$aurpkg" - -for itm in $sel; do - case $itm in - '"gpm"') - svcstart gpm - svcenable gpm - ;; - esac -done +case $sel in + "Basic") script install/console/basic;; + "Compression Tools") script install/console/compression-tools;; + "Network Tools") script install/console/network-tools;; + "Webbrowser") script install/console/webbrowser;; + "Recovery Tools") script install/console/recovery-tools;; +esac exit 0 diff --git a/install/console/network-tools b/install/console/network-tools new file mode 100644 index 0000000..1490310 --- /dev/null +++ b/install/console/network-tools @@ -0,0 +1,32 @@ +#!/bin/bash +. ./lib + +options=() +options+=("rsync" "Sync files" on) +options+=("traceroute" "Trace network route" on) +options+=("bind-tools" "DNS tools (nslookup)" on) +options+=("dnsutils" "DNS tools (nslookup)" off) +options+=("nmap" "Network scanner" off) +options+=("speedtest-cli" "SpeedTest" off) +options+=("wavemon" "WIFI monitor" off) +options+=("net-tools" "(deprecated) old ifconfig" off) +options+=("dsniff" "tools for network auditing and penetration" off) +options+=("mitmproxy" "SSL-capable MITM HTTP proxy" off) +options+=("sslstrip" "tool to hijack HTTPS in MITM attack" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Console Network Tools :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/console/recovery-tools b/install/console/recovery-tools new file mode 100644 index 0000000..03994a9 --- /dev/null +++ b/install/console/recovery-tools @@ -0,0 +1,24 @@ +#!/bin/bash +. ./lib + +options=() +options+=("ddrescue" "HD recovery tool" off) +options+=("dd_rescue" "HD recovery tool" off) +options+=("partclone" "Copy used block on partition" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Console Recovery Tools :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/console/webbrowser b/install/console/webbrowser new file mode 100644 index 0000000..6d26fa9 --- /dev/null +++ b/install/console/webbrowser @@ -0,0 +1,24 @@ +#!/bin/bash +. ./lib + +options=() +options+=("elinks" "" off) +options+=("links" "" off) +options+=("lynx" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Console Web Browser :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/menu b/install/menu index bb3d75b..128d80e 100644 --- a/install/menu +++ b/install/menu @@ -19,7 +19,7 @@ fi sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 case $sel in - "Console") script install/console/menu;; + "Console") menu install/console/menu;; "System") menu install/system/menu;; "XOrg") menu install/xorg/menu;; "Display Manager") menu install/displaymngr/menu;;