Course: Open Source Software (OSS NGMC) Student: INSHARAJ RANAWAT Registration Number: 24BCE10963 Chosen Software: Python (PSF License)
This repository contains all shell scripts and supporting materials for the Open Source Audit capstone project. The audit examines Python — its origin, philosophy, licensing, Linux footprint, ecosystem, and comparison with proprietary alternatives.
oss-audit-[24BCE10963]/
├── script1_system_identity.sh # System Identity Report
├── script2_package_inspector.sh # FOSS Package Inspector
├── script3_disk_permission_auditor.sh # Disk and Permission Auditor
├── script4_log_analyzer.sh # Log File Analyzer
├── script5_manifesto_generator.sh # Open Source Manifesto Generator
├── README.md # This file
File: script1_system_identity.sh
Displays a formatted welcome screen with system information: Linux distro name, kernel version, logged-in user, home directory, uptime, current date/time, and a message identifying the OS license and Python's PSF license.
Concepts used: Variables, echo, command substitution $(), case statement for OS detection, basic output formatting.
File: script2_package_inspector.sh
Checks whether a given open-source package is installed on the system, prints its version, license, and summary from the package manager, and displays a philosophy note about that specific package.
Concepts used: if-then-else, case statement, rpm -qi / dpkg -l, pipes with grep, command-line arguments ($1).
File: script3_disk_permission_auditor.sh
Loops through a list of important system directories and reports how much disk space each uses, and the owner, group, and permissions of each directory. Also audits Python-specific installation directories.
Concepts used: for loop, du -sh, ls -ld, awk to extract fields, conditional checks.
File: script4_log_analyzer.sh
Reads a log file line by line, counts how many lines contain a specified keyword (default: error), and prints a summary with the last 5 matching lines. Includes a do-while style retry if the file is empty.
Concepts used: while read loop, if-then, counter variables $(()), command-line arguments, grep, tail, retry logic.
File: script5_manifesto_generator.sh
Interactively asks the user three questions and composes a personalised open-source philosophy statement using their answers, then saves it to a .txt file named after the current user.
Concepts used: read for user input, string concatenation, heredoc (<< EOF), file writing with >, date command, alias demonstration.
- A Linux system (Ubuntu, Fedora, Debian, or any major distro)
- Bash shell (version 4.0 or higher — check with
bash --version) - No additional dependencies required for any script
git clone
cd oss-audit-[24BCE10963]chmod +x script1_system_identity.sh
chmod +x script2_package_inspector.sh
chmod +x script3_disk_permission_auditor.sh
chmod +x script4_log_analyzer.sh
chmod +x script5_manifesto_generator.shScript 1 — System Identity Report
./script1_system_identity.shNo arguments needed. Displays system information automatically.
Script 2 — FOSS Package Inspector
# Inspect Python (default audit subject)
./script2_package_inspector.sh python3
# Inspect any other OSS package
./script2_package_inspector.sh git
./script2_package_inspector.sh firefox
./script2_package_inspector.sh vlcScript 3 — Disk and Permission Auditor
./script3_disk_permission_auditor.shNo arguments needed. Audits standard system directories and Python paths automatically.
Script 4 — Log File Analyzer
# Basic usage — search for 'error' in syslog
./script4_log_analyzer.sh /var/log/syslog
# Search for a specific keyword
./script4_log_analyzer.sh /var/log/syslog warning
./script4_log_analyzer.sh /var/log/auth.log failed
# On Fedora/RHEL systems
./script4_log_analyzer.sh /var/log/messages errorScript 5 — Open Source Manifesto Generator
./script5_manifesto_generator.shInteractive — will prompt you for three answers. The manifesto is saved to manifesto_<username>.txt in the current directory.
All scripts use only standard Linux utilities available on any distribution:
| Utility | Purpose | Available By Default |
|---|---|---|
bash |
Shell interpreter | Yes |
uname |
Kernel/OS info | Yes |
whoami |
Current user | Yes |
uptime |
System uptime | Yes |
date |
Date/time | Yes |
du |
Disk usage | Yes |
ls |
File/dir info | Yes |
awk |
Text processing | Yes |
grep |
Pattern matching | Yes |
tail |
Last N lines | Yes |
rpm |
Package info (RPM systems) | On RHEL/Fedora |
dpkg |
Package info (DEB systems) | On Debian/Ubuntu |
No external packages need to be installed.
Python is a high-level, general-purpose programming language first released by Guido van Rossum in 1991. It is distributed under the Python Software Foundation (PSF) License, an OSI-approved permissive license that allows use in both open-source and proprietary software.
Key facts:
- License: PSF License 2.0 (permissive, OSI-approved)
- Governance: Python Software Foundation (PSF)
- Package Manager: pip (Python Package Index — PyPI)
- Linux package name:
python3(most distros)
All scripts in this repository are original work written by JALAJ SRIVASTAVA, 24BCE10130. All comments and logic are the author's own. Scripts are designed to run on real Linux systems and demonstrate genuine understanding of shell scripting concepts as required by the OSS NGMC course rubric.