Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Reveal Bash Script Development Thread


  • Please log in to reply
322 replies to this topic

#1 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 09 May 2015 - 01:27 AM

This is a developement thread for some bash scripts I'm making called "Reveal" for various Linux operating systems, that collect some useful system information people commonly add to threads. Reveal does not just to run a series of commands, but also to places the information into a formatted output. Each OS version supported will have it's own edition of Reveal, and the scripts will be release specific. (For example "Reveal For Linux Mint 17.1 - Cinnamon X86-64 - 1.0" would be
the 1.0 release of Reveal for Linux Mint's 17.1 release of their X86-64 version of their Cinnamon flavour.) Whilst I have started this project, other people are welcome to join in (experts and beginners a like)! This is not a serious project, it's just for fun, curing boredom, etc, and will probably die after a couple of weeks I suspect.

To keep things organized, and moving towards the project goals I'll administrate the project. Basically the way it will work is I'll start a discussion about something, we'll discuss it, I'll call a vote, we'll vote, and then I'll end the discussion. If a discussion requires it's results to be implemented one of us will do so by posting a Testing release with that change. Once we have a testing release we think is solid and useful we'll repost as a stable release. Please keep to the current discussion when posting, and post [DISCUSSTIONTITLE] as a hyperlink at the top of your posts so people can easily tell what the current discussion is.



BC AdBot (Login to Remove)

 


#2 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 09 May 2015 - 01:31 AM

Reveal For Linux Mint 17.1 - Cinnamon X86-64 0.1 Testing

 

This is a testing release and should be used only by devs in a testing environment.

#!/bin/bash
#Reveal For Linux Mint 17.1 - Cinnamon X86-64 0.1 Testing
#To run the script type "bash /locationofsript/reveal.sh".
#Collects CPU Model
raw_model=$(cat /proc/cpuinfo | grep -a "model name")
model=${raw_model:13}
#Collects CPU architecture
raw_arch=$(lscpu | grep -a "Architecture")
arch=${raw_arch:23}
#Collects CPU Clock Rate
raw_cr=$(lscpu | grep -a "CPU MHz")
cr=${raw_cr:23}
#Collects Number Of Cores
raw_cps=$(lscpu | grep -a "Core(s) per socket")
cps=${raw_cps:23}
#Displays Results
echo System Information
echo CPU: $model $cr MHz $cps core $arch

Edited by hollowface, 09 May 2015 - 01:31 AM.


#3 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 09 May 2015 - 01:34 AM

DISCUSSION #1: What information will be collected?



#4 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 09 May 2015 - 05:56 PM

[DISCUSSION #1: What information will be collected?]

My Suggestions:
- CPU model(s), number of CPU cores, CPU clock-rate (rated rate and running rate), CPU architecture, CPU virtualization support, and PAE support. Useful for installation questions. Useful for questions about virtual machines.
- GPU model(s), and amount of dedicated GPU memory. Useful for installation questions.
- Amount of ram. Useful for installation questions. Useful for program recommendation questions.
- Network adapter model(s), adapter types, configured adapters, IPv4 and IPv6 method (eg: DHCP, manual), and confirm configured adapters have an IP address (eg: Valid IP: Yes/No). I don't think it would be wise to display the IPs though. Useful for installation questions. Useful for network issue questions.
- Storage devices, partition table type, partitions, partition types, optical media devices, optical media device types. Useful for installation questions. Useful for system-backup questions.
- If computer is running BIOS, EFI, or UEFI. Useful for installation questions.
- The current operating system, and current kernel. Useful for installation questions. Useful for program recommendation questions.



#5 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 10 May 2015 - 01:48 PM

[DISCUSSION #1: What information will be collected?]

 

End of discussion. There is no point in calling a vote for this discussion.

 

Results:

Reveal will collect: CPU model(s), number of CPU cores, CPU clock-rate (rated rate and running rate), CPU architecture, CPU virtualization support, CPU PAE support. GPU model(s), amount of dedicated GPU memory, amount of system memory, network adapter model(s), adapter types, configured adapters, IPv4 and IPv6 method (eg: DHCP, manual), confirm configured adapters have an IP address, storage devices, partition table type, partitions, partition types, optical media devices, optical media device types, if computer is running BIOS, EFI, or UEFI, current operating system, current operating system kernel.



#6 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 10 May 2015 - 02:20 PM

DISCUSSION #2: How will the output be formatted and what will be done with it?

When the script is run how should the result to be organized, and will it simply be displayed in the terminal or will something else to happen (eg: being saved to a file)?



#7 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 10 May 2015 - 03:09 PM

[DISCUSSION #2: How will the output be formatted and what will be done with it?]
 
I think it would make sense to break it into sections by type of information (eg: CPUs), sub-sections for the specific items (eg: Intel Core 2 duo), and then details within the sub-sections. I think some details should be appended to model names instead of listed as details. Some things won't conform, like RAM, but that's okay they can just be listed as standalone details. I think this type of layout is a good choice because it will be easy to follow, and easy to expand upon if additional things are added to future releases of the script. Here's a visual of the layout I've described with notes in () to help explain:
 
System Information
CPUs:
- CPU Model Name (and some details like the rated-clock rate, running clock-rate, number of cores)
  - Virtualization support:
  - PAE support:
 
GPUs:
- GPU Model Name (and some details like the amount of dedicated memory)
  - N/A
 
RAM: amount of ram
 
Network Adapters:
- Adapter Model Name
  - Adapter type:
  - Configured:
  - IP Address: This is just a confirmation, as discussed the actual address is not displayed.
  - IPv4 method:
  - IPv6 method:
 
Storage Devices (as in hard-drives, ssds, flash-drives)
- Device Model Name
  - Partition-table type: (eg MBRPT or GPT)
  - Partitions: 
    - /dev/sda1: Label:ESP, Filesystem:fat32, etc (the information shown here is just an example)
    - /dev/sda2: Label:OSP, Filesystem:ext4, etc (the information shown here is just an example)
    - /dev/sda3: Filesystem:swap, etc (the information shown here is just an example)

Media Devices (as in optical media devices like DVD burners)
- Device Model Name (and type like DVD+RW DL Writer)

Operating System: OS Name (and the kernel)

Active Computer Firmware Interface: (this is where it would say UEFI, EFI, or BIOS)
 

Edited by hollowface, 10 May 2015 - 03:26 PM.


#8 NickAu

NickAu

    Bleepin Grumpy Aussie


  •  Avatar image
  • Members
  • 26,114 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Australia

Posted 10 May 2015 - 04:12 PM

 

Network Adapters:

Will this include WiFi?


"When God shuts a Window, he opens a Linux." —Linus 8:7

 

 

 

 


#9 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 10 May 2015 - 05:21 PM

[DISCUSSION #2: How will the output be formatted and what will be done with it?]

 

 

 

Network Adapters:

Will this include WiFi?

 

 

That's what I was thinking, because then under adapter type it could specify wether it's a wireless or a cabled connection, perhaps accompanied by it's speed rating b/g/n/n+/etc for wifi and 10/100/1000/etc for cabled.



#10 NickAu

NickAu

    Bleepin Grumpy Aussie


  •  Avatar image
  • Members
  • 26,114 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Australia

Posted 10 May 2015 - 10:30 PM

 

perhaps accompanied by it's speed rating b/g/n/n+/etc for wifi and 10/100/1000/etc for cabled.

Cool.


"When God shuts a Window, he opens a Linux." —Linus 8:7

 

 

 

 


#11 DeimosChaos

DeimosChaos

  •  Avatar image
  • Members
  • 1,458 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware

Posted 11 May 2015 - 09:46 AM

Definitely interested in helping out with this were I can/when I can. I do a decent amount of bash/python/ruby/perl scripting for work, so I am decently versed in the ways of bash, and this looks like fun.


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +

#12 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 11 May 2015 - 06:46 PM

[DISCUSSION #2: How will the output be formatted and what will be done with it?]

 

End of discussion. No vote will be called for this discussion as there is no point.

 

Results:

The output will be just be to the terminal, and will be broken into sections, sub-sections, and details within, though some exceptions will apply. A rough example is shown below:

 


System Information
CPUs:
- CPU Model Name (and some details like the rated-clock rate, running clock-rate, number of cores)
  - Virtualization support:
  - PAE support:
 
GPUs:
- GPU Model Name (and some details like the amount of dedicated memory)
  - N/A
 
RAM: amount of ram
 
Network Adapters:
- Adapter Model Name
  - Adapter type:
  - Configured:
  - IP Address: This is just a confirmation, as discussed the actual address is not displayed.
  - IPv4 method:
  - IPv6 method:
 
Storage Devices (as in hard-drives, ssds, flash-drives)
- Device Model Name
  - Partition-table type: (eg MBRPT or GPT)
  - Partitions: 
    - /dev/sda1: Label:ESP, Filesystem:fat32, etc (the information shown here is just an example)
    - /dev/sda2: Label:OSP, Filesystem:ext4, etc (the information shown here is just an example)
    - /dev/sda3: Filesystem:swap, etc (the information shown here is just an example)

Media Devices (as in optical media devices like DVD burners)
- Device Model Name (and type like DVD+RW DL Writer)

Operating System: OS Name (and the kernel)

Active Computer Firmware Interface: (this is where it would say UEFI, EFI, or BIOS)


#13 NickAu

NickAu

    Bleepin Grumpy Aussie


  •  Avatar image
  • Members
  • 26,114 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Australia

Posted 11 May 2015 - 10:29 PM

Identify USB ports by type, EG. USB 1,2 or 3


"When God shuts a Window, he opens a Linux." —Linus 8:7

 

 

 

 


#14 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 12 May 2015 - 12:11 AM

Identify USB ports by type, EG. USB 1,2 or 3


I think that's a great idea, perhaps do the same for sata ports too? However DISCUSSION #1: What information will be collected? has ended. I'm trying to keep the operation of this thread offical-like-ish. Future releases of Reveal will of course have dicussions for expansion so this could be added then along with other cool stuff.

#15 Guest_hollowface_*

Guest_hollowface_*

  •  Avatar image
  • Guests
  • OFFLINE
  •  

Posted 12 May 2015 - 12:31 AM

DISCUSSION #3: What OS will Reveal support?

As time goes on Reveal will be ported to support more than 1 operating system, but right now a primary OS to support needs to be chosen. This discussion is now open.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users