-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
121 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
.vscode/ | ||
desktop.ini | ||
/src/installShell.sh | ||
priv-*.cfg.sh | ||
local.* | ||
*.fr.conf | ||
/src/bin/ca/ | ||
*.com.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[submodule "src/autosave"] | ||
path = src/autosave | ||
url = https://github.com/ojullien/bash-autosave.git | ||
[submodule "src/autosavedb"] | ||
path = src/autosavedb | ||
url = https://github.com/ojullien/bash-autosavedb.git | ||
[submodule "src/clean"] | ||
path = src/clean | ||
url = https://github.com/ojullien/bash-clean.git | ||
[submodule "src/createdomain"] | ||
path = src/createdomain | ||
url = https://github.com/ojullien/bash-createdomain.git | ||
[submodule "src/fillwithzeros"] | ||
path = src/fillwithzeros | ||
url = https://github.com/ojullien/bash-fillwithzeros.git | ||
[submodule "src/install"] | ||
path = src/install | ||
url = https://github.com/ojullien/bash-install.git | ||
[submodule "src/manageservices"] | ||
path = src/manageservices | ||
url = https://github.com/ojullien/bash-manageservices.git | ||
[submodule "src/pki"] | ||
path = src/pki | ||
url = https://github.com/ojullien/bash-pki.git | ||
[submodule "src/savedb"] | ||
path = src/savedb | ||
url = https://github.com/ojullien/bash-savedb.git | ||
[submodule "src/savesite"] | ||
path = src/savesite | ||
url = https://github.com/ojullien/bash-savesite.git | ||
[submodule "src/savesystemconf"] | ||
path = src/savesystemconf | ||
url = https://github.com/ojullien/bash-savesystemconf.git | ||
[submodule "src/sys"] | ||
path = src/sys | ||
url = https://github.com/ojullien/bash-sys.git | ||
[submodule "src/tartime"] | ||
path = src/tartime | ||
url = https://github.com/ojullien/bash-tartime.git | ||
[submodule "src/updatesystem"] | ||
path = src/updatesystem | ||
url = https://github.com/ojullien/bash-updatesystem.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,48 @@ | ||
# Shell | ||
|
||
Personal Shell scripting projects. | ||
Personal Shell scripting projects in bash. This package is a metapackage aggregating the following bash components (as submodules): | ||
|
||
- Core framework | ||
- [sys](https://github.com/ojullien/bash-sys) contains scripts that offer useful functions. | ||
- Applications | ||
- [autosave](https://github.com/ojullien/bash-autosave): Builds a timestamped compressed archive with system logs, web logs and send it to a ftp server. | ||
- [autosavedb](https://github.com/ojullien/bash-autosavedb): Builds a timestamped compressed archive with databases data, and send it to a ftp server. | ||
- [clean](https://github.com/ojullien/bash-clean): Cleans the /var/log folder. | ||
- [createdomain](https://github.com/ojullien/bash-createdomain): Creates an apache user/group and a home directory in /var/www. | ||
- [fillwithzeros](https://github.com/ojullien/bash-fillwithzeros): Fills disks with zero for compression (virtualization) and shutdown the server. | ||
- [install](https://github.com/ojullien/bash-install): Configures a fresh debian/ubuntu installation. | ||
- [manageservices](https://github.com/ojullien/bash-manageservices): Disable, start or stop a list of services defined in the config.sh file. | ||
- [pki](https://github.com/ojullien/bash-pki): Simple Public Key Infrastructure (PKI) management toolkit. | ||
- [savedb](https://github.com/ojullien/bash-savedb): Saves a database. | ||
- [savesite](https://github.com/ojullien/bash-savesite): Saves a www site (located in /var/www). | ||
- [savesystemconf](https://github.com/ojullien/bash-savesystemconf): Saves a system configuration (located in /etc). | ||
- [tartime](https://github.com/ojullien/bash-tartime): Tar and compress files to a timestamped bz2 archive. Standalone script located in bin folder. | ||
- [updatesystem](https://github.com/ojullien/bash-updatesystem): Updates the system. | ||
|
||
*As I use these scripts for my own projects, they contain only the features I need.* | ||
|
||
## Table of Contents | ||
|
||
[Installation](#installation) | [Features](#features) | [Documentation](#documentation) | [Test](#test) | [Contributing](#contributing) | [License](#license) | ||
[Installation](#installation) | [Documentation](#documentation) | [Contributing](#contributing) | [License](#license) | ||
|
||
## Installation | ||
|
||
Require a Debian/Ubuntu version of linux and a Bash version ~4.4. | ||
|
||
1. [Download a release](https://github.com/ojullien/Shell/releases) or clone this repository. | ||
2. Use [scripts/installShell.sh](https://github.com/ojullien/Shell/tree/master/scripts) to automatically install the project in the /opt/ folder. | ||
3. If needed, add `PATH="$PATH:/opt/oju/Shell/bin"` to the .profile files. | ||
4. For each apps in [app folder](https://github.com/ojullien/Shell/tree/master/src/app) check out and edit the configuration file named `config.sh`. | ||
5. Run the app you want. In [Shell/bin](https://github.com/ojullien/Shell/tree/master/src/bin) folder run `./<app_name>.sh` or `bash <app_name>.sh`. | ||
|
||
All the main app scripts can take, at least, the following options: | ||
|
||
- `-n | --no-display` Display mode. Contents are not displayed. | ||
- `-l | --active-log` Log mode. Contents are logged. | ||
- `-w | --wait` Wait user. Wait for user input between actions. | ||
- `-h | --help` Show the help.. | ||
- `-v | --version` Show the version. | ||
|
||
## Features | ||
|
||
- Core framework | ||
- [sys](https://github.com/ojullien/Shell/tree/master/src/sys) contains scripts that offer useful functions: | ||
- db/mariadb.sh: MariaDB functions. | ||
- db/mysql.sh: MySQL functions. | ||
- bashversion.sh: Tests the current bash version. | ||
- config.sh: Load local app configuration file. | ||
- constant.sh: Core constants. | ||
- filesystem.sh: file system functions. | ||
- ftp.sh: FTP functions. | ||
- openssl.sh: openssl-req and openssl-x509 wrapper functions. | ||
- option.sh: common command line options functions. | ||
- package.sh: package manager (dpkg, apt, aptitude) | ||
- runasroot.sh: Tests the user credentials. | ||
- service.sh: service manager (use system/d.sh or system/v.sh) | ||
- ssh.sh: SSH functions. | ||
- string.sh: string functions. | ||
- system/d.sh: System V service manager. | ||
- system/v.sh: systemd service manager. | ||
|
||
- Applications | ||
- [app/](https://github.com/ojullien/Shell/tree/master/src/app) contains the main core files (functions, configurations, ...) for each apps. | ||
- autosave: Builds a timestamped compressed archive with system logs, web logs and send it to a ftp server. Clean the system log after that. | ||
- autosavedb: Builds a timestamped compressed archive with databases data, and send it to a ftp server. | ||
- clean: Cleans the /var/log folder. | ||
- createdomain: Creates an apache user/group and a home directory in /var/www. | ||
- fillwithzeros: Fills disks with zero for compression (virtualization) and shutdown the server. | ||
- install: Configures a fresh debian/ubuntu installation. (ssh is already installed and configured) | ||
- Initial update and upgrade | ||
- update source.list | ||
- update system | ||
- upgrade system | ||
- Install or modify .bashrc, .bash_alias, .bash_profile, .profile files | ||
- Configure swap | ||
- Uninstall packages (vim-tiny, ...) | ||
- Install system packages (dkms, build-essential, util-linux, deborphan, localepurge, hdparm, smartmontools, ...) | ||
- Install and configure app packages (vim, fail2ban, ftp, mlocate, chkrootkit, logwatch, ...) | ||
- Optimize SSD | ||
- manageservices: Disable, start or stop a list of services defined in the config.sh file. | ||
- pki: Simple Public Key Infrastructure (PKI) management toolkit. | ||
- savedb: Saves a database. | ||
- savesite: Saves a www site (located in /var/www). | ||
- savesystemconf: Saves a system configuration (located in /etc). | ||
- tartime: Tar and compress files to a timestamped bz2 archive. Standalone script located in bin folder. | ||
- update-system: Updates the system. | ||
1. [Download a release](https://github.com/ojullien/Shell/releases) or clone this repository using thsi command: `git clone --recurse-submodules https://github.com/ojullien/Shell`. | ||
2. Use [scripts/install.sh](https://github.com/ojullien/Shell/tree/master/scripts) to automatically install the project in the /opt/oju/bash folder. | ||
3. If needed, add `PATH="$PATH:/opt/oju/bash/bin"` to the .profile files. | ||
4. For each apps in `/opt/oju/bash/app` check out and edit the configuration file named `config.sh`. | ||
5. Run the app you want. In `/opt/oju/bash/bin` folder run `./<app_name>.sh` or `bash <app_name>.sh`. | ||
|
||
## Documentation | ||
|
||
I wrote and I use these scripts for my own projects. And, unfortunately, I do not provide exhaustive documentation. Please read the code and the comments ;) | ||
|
||
## Test | ||
|
||
I wrote few lines of 'unit test' code for the core framework (sys). No more, sorry. | ||
|
||
## Contributing | ||
|
||
Thanks you for taking the time to contribute. Please fork the repository and make changes as you'd like. | ||
|
||
As I use these scripts for my own projects, it contains only the features I need. But If you have any ideas, just open an [issue](https://github.com/ojullien/Shell/issues/new) and tell me what you think. Pull requests are also warmly welcome. | ||
|
||
If you encounter any **bugs**, please open an [issue](https://github.com/ojullien/Shell/issues/new). | ||
|
||
Be sure to include a title and clear description,as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. | ||
**Thanks you for taking the time to contribute**. If you wish to contribute, please read the [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) files. | ||
|
||
## License | ||
|
||
This project is open-source and is licensed under the [MIT License](https://github.com/ojullien/Shell/blob/master/LICENSE). | ||
This project is open-source and is licensed under the [MIT License](LICENSE). |
File renamed without changes.
Submodule autosavedb
added at
0524fe
Submodule createdomain
added at
2d94d8
Submodule fillwithzeros
added at
5e06e9
Submodule manageservices
added at
969bea
Submodule savesystemconf
added at
15fc14
Submodule updatesystem
added at
b74dfc