2014-02-21 59 views
0

我編寫這個猛砸我想添加到選項對話框bash腳本

#!/bin/bash 

options=( 
    --backtitle "Setup Scripts " 
    --title "[Main Menu]" 
    --menu "You can use the UP/DOWN arrow keys, Or the number keys 1-9 to choose an option. 
Choose the option" 18 70 8 
) 

choices=(
    Setup   "Start Setup And Secure this Server" 
    Nginx_Setup  "Install Nginx" 
    Anti_MaleWare "Install Anti-MaleWare" 
    Softaculous  "Install Softaculous" 
    ModSec   "Install ModSecurity" 
    OpsView   "Add OpsView Agent" 
    External_Backup "Add This Server To External Backup" 
    Check_Backup "Check Backup Configration" 
) 

menuitem=$(dialog "${options[@]}" "${choices[@]}" 3>&1 1>&2 2>&3 3>&-) 

case $menuitem in 
    Setup)   setup ;; 
    Nginx_Setup)  nginx ;; 
    Anti-MaleWare) anti-maleware ;; 
    Softaculous)  Softaculous ;; 
    ModSec)   modsec ;; 
    OpsView)   opsview ;; 
    External_Backup) externalbackup ;; 
    Check_Backup) configbackup ;; 
    "")    clear ;; 
esac 

出版社Nginx的設置如何添加選項當我按下設置要花葯bash的設置,或者去猛砸安裝程序Nginx的?

回答

0

你有兩個選擇,要麼你在你的腳本創建每個菜單項的功能,如:

function setup { 
    # code to show the new dialog with all the new options and chioces 
} 

或你與新的對話框,胃內獨立腳本對於設置選項你犯了一個新的安裝腳本文件,你不是從你的情況塊這樣的電話:

Setup)   ./setup ;; 
相關問題