Bash Shell Scripting

If you are a system admin, and you wanna automate stuff you would do manually, then you can learn shell scripting, I recently created a full-blown Control Panel using only shell scripting, it is a menu-driven program that can

  • Install and Configure Multiple ClassicPress or WordPress Sites
  • Restore an Existing ClassicPress or Wordpress Website
  • Secure Sites Using Free Let’s Encrypt Certificate
  • You Can Create More Than one SFTP Users (This Way, You Can Access Through SFTP Client, e,g Filezilla, Winscp, etc)
  • Manage Your Own Custom DNS (You can also Add New DNS Zone, Edit Zone, and Even Delete DNS Zone)
  • Install PHPMyAdmin (You can also secure it with Let’s Encrypt)
  • Automate The Backup of the Complete Sites On The Server (De-duplication)
  • Many more

If you want to learn how to do something like that, then welcome to this page, you’ll learn a lot about bash scripting. Here is a link to the controlpanel

Lastly,¬†I created this page to documents all I have learned on Bash Scripting, instead of reading the manual every time I need to use a specific function or I wanna learn a certain syntax, I’ll hop in here to find the details, and the bad thing about me is that I can only understand my very own explanation ūüôā

  • Creating Multiple Menus in Bash Scripts

    Creating Multiple Menus in Bash Scripts

    I have been writing a couple of scripts now for different use cases, wouldn’t it be handy to build a menu which will provide a list of command select to choose from? e.g It can contain all sorts of script in one mega script. Basically, the menu will loop until the user chooses to exit from ...

    Read Full Post
  • Bash Script For Optimizing ClassicPress & WordPress Images in Bulk

    Bash Script For Optimizing ClassicPress & WordPress Images in Bulk

    Out of frustration of the way different plugin optimizes images (which is super limited, and not effective; it has never been for me)in the WordPress world, I decided to create a script that does it on a server level. This script would recursively optimize PNG or JPEG images using the convert command and the pngquant respectively. Note: Tested on ...

    Read Full Post
  • Iterating With Loops (Bash)

    Iterating With Loops (Bash)

    Imagine having to edit 10,000 lines of text within a CSV file, this would be a shit load of work if done manually, which is where looping comes in. When a task or a series of tasks needs to be repeated, it can be put inside a loop. In this guide, we would look at for, ...

    Read Full Post
  • Script to Replace/substitute Multi Occurrences of A String in Files

    Script to Replace/substitute Multi Occurrences of A String in Files

    There are a couple of ways you can replace a string in a file, and an example is using the mv command, but what if you want to replace multiple strings at once, then you might consider creating a loop, which loops through all the file in your target directory, and you then replace the ...

    Read Full Post
  • Creating Conditional Statements Using if And Else (Bash)

    Creating Conditional Statements Using if And Else (Bash)

    We have recently explored command-line list, we also dived into the test shell builtin command, which can not only be used to check file types but can also be used to compare values. The issue with using those conditions is that aren’t easy to read, and it would become difficult to maintain if the complexity ...

    Read Full Post