Esempio di Menu per gestione Aix


// aix.m
//------------------------------------------------------------------------------
// sub definition
//------------------------------------------------------------------------------


SUB SysAttr {
  lsattr -H -E -l sys0
  read A
}

SUB PredefDevice {
  echo "Elenco device predefiniti"
  lsdev -P -H | more
}
SUB SysConf {
  lscfg -v | more
}
SUB ListDisk (
  DEV=`lsdev -C -c disk | awk '{ print $1 }'`
  lsdev -C -c disk
  lsattr -H -l $DEV -E
  read A
)
SUB ListDiskette (
  DEV=`lsdev -C -c diskette | awk '{ print $1 }'`
  lsdev -C -c diskette
  lsattr -H -l $DEV -E
  read A
)
SUB ListTape (
  DEV=`lsdev -C -c tape | awk '{ print $1 }'`
  lsdev -C -c tape
  lsattr -H -l $DEV -E
  read A
)
SUB ListPrinter (
  DEV=`lsdev -C -c printer | awk '{ print $1 }'`
  lsdev -C -c printer
  lsattr -H -l $DEV -E
  read A
)
SUB ListCdrom {
  lsdev -C -c cdrom
  lsattr -H -l $DEV -E
  read A
}
SUB ListNetwork {
  lsdev -C -c if
  do
    echo "--------------------- $i ---------------------"
    lsattr -H -l $i -E
  done | more
  read A
}
SUB ListSerial {
  lsdev -C -c tty
  do
    echo "--------------------- $i ---------------------"
    lsattr -H -l $i -E
  done | more
}

SUB Traceroute {
  printf "Insert host to trace ? "; read H
  traceroute $H | more
}

// SUB LIST ALL
// EXIT



//------------------------------------------------------------------------------
// menu definition
//------------------------------------------------------------------------------
MENUBAR  1
  MENU   "General"          0 0 0 null     null
    ITEM "FileSystems"      null 
                            "View active filesystems"  
                            EXEC "df; read A"
    ITEM "SysAttribute"     null 
                            "Display attribute of the system"  
                            CALL SysAttr
    ITEM "PredefDevice"     null 
                            "Help"  
                            CALL PredefDevice
    ITEM "Shutdown"         null 
                            "Exec a shutdown of the system. You must be root."  
                            EXEC "shutdown +'1' 'system shutdown'"
    ITEM "Restart"          null 
                            "Exec a restart of the system. You must be root."  
                            EXEC "shutdown -r'' +'1' 'system shutdown'"
    ITEM "Quit"             null 
                            "Quit from the menu"  
                            [QUIT]

  MENU   "Conf"             0 0 0  null     null
    ITEM "SysConf"          null 
                            "help"  
                            CALL SysConf
    ITEM "PagingSpace"      null 
                            "help"  
                            EXEC "lsps -a; read A"
    ITEM "Memory"           null 
                            "get real memory of the machine"  
                            EXEC "bootinfo -r; read A"
    ITEM "ListAdapters"     null 
                            "list adapter configurated"  
                            EXEC "lsdev -C -c adapter; read A"
    ITEM "ListDisk"         null 
                            "list disks."  
                            EXEC "lspv; read A"
    ITEM "ListTape"         null 
                            "list tapes."  
                            CALL ListTape
    ITEM "ListPrinter"      null 
                            "list printers."  
                            CALL ListPrinter
    ITEM "ListCdrom"        null 
                            "help"  
                            CALL ListCdrom
    ITEM "ListDiskette"     null 
                            "help"  
                            CALL ListDiskette
    ITEM "ListNetwork"      null 
                            "help"  
                            CALL ListNetwork
    ITEM "ListSerial"       null 
                            "help"  
                            CALL ListSerial

  MENU   "Files"            0 0 0  null     null
    ITEM "passwd"           null 
                            "help"  
                            EXEC "vi /etc/passwd"
    ITEM "group"            null 
                            "help"  
                            EXEC "vi /etc/group"
    ITEM "hosts"            null 
                            "help"  
                            EXEC "vi /etc/hosts"
    ITEM "------------"     null " "  NULL
    ITEM "services"         null 
                            "help"  
                            EXEC "vi /etc/services"
    ITEM "protocols"        null 
                            "help"  
                            EXEC "vi /etc/protocols"
    ITEM "filesystems"      null 
                            "help"  
                            EXEC "vi /etc/filesystems"
    ITEM "inittab"          null 
                            "help"  
                            EXEC "vi /etc/inittab"
    ITEM "environment"      null 
                            "help"  
                            EXEC "vi /etc/environment"
    ITEM "profile"          null 
                            "help"  
                            EXEC "vi /etc/profile"
    ITEM "------------"     null " "  NULL
    ITEM "UUCP_Devices"     null "help"  
                            EXEC "vi /etc/uucp/Devices"
    ITEM "UUCP_Systems"     null "help"  
                            EXEC "vi /etc/uucp/Systems"
    ITEM "UUCP_Dialers"     null "help"  
                            EXEC "vi /etc/uucp/Dialers"
    ITEM "------------"     null " "  NULL
    ITEM "bootlog"          null "help"  
                            EXEC "alog -o -f '/var/adm/ras/bootlog'| more"
    ITEM "bosinst"          null "help"  
                            EXEC "alog -o -f '/var/adm/ras/bosinstlog'|more"
    ITEM "nim"              null "help"  
                            EXEC "alog -o -f '/var/adm/ras/nimlog'|more"
    ITEM "dumpsysp"         null "help"  
                            EXEC "alog -o -f '/var/adm/ras/dumpsymplog'|more"

  MENU   "Network"          0 0 0  null     null
    ITEM "hostname"         null "help"  
                            EXEC "hostname; read A"
    ITEM "Netstat"          null "help"  
                            EXEC "netstat | more"
    ITEM "Interface"        null "help"  
                            EXEC "netstat -i; read A"
    ITEM "RoutingTable"     null "help"  
                            EXEC "netstat -r; read A"
    ITEM "Statistics"       null "help"  
                            EXEC "netstat -s | more"
    ITEM "PacketCount"      null "help"  
                            EXEC "netstat -D | more"
    ITEM "traceroute"       null "help"  
                            CALL Traceroute
    ITEM "ifconfig"         null "help"  
                            EXEC "ifconfig en0; read A"

  MENU   "RC"               0 0 0  null     null
    ITEM "rc"               null "help"  
                            EXEC "vi /etc/rc"
    ITEM "net"              null "help"  
                            EXEC "vi /etc/rc.net"
    ITEM "tcpip"            null "help"  
                            EXEC "vi /etc/rc.tcpip"
    ITEM "bsdnet"           null "help"  
                            EXEC "vi /etc/rc.bsdnet"
    ITEM "net.serial"       null "help"  
                            EXEC "vi /etc/rc.net.serial"
    ITEM "netware"          null "help"  
                            EXEC "vi /etc/rc.netware"
    ITEM "nfs"              null "help"  
                            EXEC "vi /etc/rc.nfs"

  MENU   "Monitors"         0 0 0  null     null
    ITEM "iostat_tty"       null "help"  EXEC "iostat -t 1"
    ITEM "iostat_disk"      null "help"  EXEC "iostat -d 1"
    ITEM "vmstat"           null "help"  EXEC "vmstat 1"
    ITEM "vmstat_fork"      null "help"  EXEC "vmstat -f"
    ITEM "vmstat_stats"     null "help"  EXEC "vmstat -s | more"
    ITEM "nfsstat"          null "help"  EXEC "nfsstat | more"

  MENU   "OtherMenus"0 0 0  null     null
    ITEM "Cics"             null 
                            "Active menu for manage cics"  
                            EXEC "cmenu -b /usr/local/menu/cics.m"
    ITEM "Db2"              null 
                            "Active menu for manage db2"  
                            EXEC "cmenu -b /usr/local/menu/db2.m"
    ITEM "Cobol"            null 
                            "Active menu for manage cobol"  
                            EXEC "cmenu -b /usr/local/menu/cobol.m"
    ITEM "Spool"            null 
                            "Active menu for manage spooler"  
                            EXEC "cmenu -b /usr/local/menu/spool.m"
    ITEM "FileSys"            null 
                            "Active menu for manage filesystems"  
                            EXEC "cmenu -b /usr/local/menu/filesys.m"

  MENU   ""            0 0 0  null     null

// SLEEP            1
RUNMENUBAR                1