- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitattributes | ||
| bashrc_custom | ||
| bashrc_custom.sha256 | ||
| bootstrap.sh | ||
| install.sh | ||
| install.sh.sha256 | ||
| README.md | ||
| update-checksums.sh | ||
Shared Bash configuration
Keep your portable Bash settings in bashrc_custom. The installer copies it to
~/.bashrc_custom and adds one source line to the machine's existing ~/.bashrc.
Run the installer again whenever you want to update a machine.
Interactive shells have a green user@host prompt (red for root) and a blue
working directory. Supported versions of ls and grep use colors for terminal
output; ll and la also inherit the ls colors. Unsupported terminals use a
plain prompt. Set NO_COLOR=1 before loading the configuration to skip enabling
colors (this does not remove color settings already loaded by another config).
Host on Forgejo
Create a public repository named bash under LGB_Salzburg on
https://git.martin-wiesinger.at and upload these files to its main branch.
The repository name bash is assumed for this setup.
The configuration's raw URL will be:
https://git.martin-wiesinger.at/LGB_Salzburg/bash/raw/branch/main/bashrc_custom
Forgejo's file view also has a Raw link you can copy. Adjust the branch in the
URL if you use a name other than main.
Install on a machine (public repository)
Requires Bash, curl, and sha256sum (GNU coreutils). Run this one line in Bash:
(set -o pipefail; curl -fsSL --proto '=https' --proto-redir '=https' https://git.martin-wiesinger.at/LGB_Salzburg/bash/raw/branch/main/bootstrap.sh | bash) && source ~/.bashrc
The bootstrap script downloads and verifies the installer's SHA-256 checksum.
The installer then verifies the configuration before installing it. The final
source loads the settings into your current shell only if installation succeeds.
The bootstrap itself is executed directly from the HTTPS download.
Alternatively, download and verify the installer without a bootstrap script:
(
set -euo pipefail
base_url='https://git.martin-wiesinger.at/LGB_Salzburg/bash/raw/branch/main'
download_dir=$(mktemp -d)
trap 'rm -rf -- "$download_dir"' EXIT
cd -- "$download_dir"
curl -fsSL "$base_url/install.sh" -o install.sh
curl -fsSL "$base_url/install.sh.sha256" -o install.sh.sha256
sha256sum --check --strict install.sh.sha256
bash install.sh "$base_url/bashrc_custom"
) && source ~/.bashrc
Once installed and loaded, update and reload your current shell with:
update-bashrc
This command downloads the latest configuration from main, verifies its SHA-256
checksum and Bash syntax, backs up the existing file, and sources ~/.bashrc.
A failed download or validation leaves the installed configuration untouched.
If you installed a fixed commit, this command switches you to the latest main.
You can also rerun the installation block. Downloads are explicit; opening a shell
does not contact the server. The installer verifies bashrc_custom.sha256 and
checks Bash syntax before replacing the configuration, and avoids duplicate
source lines. Missing or mismatched checksums abort installation.
Checksums detect corruption or mismatched versions. Since they come from the
same repository, they do not protect against someone changing both files and
their checksums. For a fixed version, replace branch/main with commit/COMMIT_SHA
in base_url.
Install from a checkout
You can also clone the public repository:
git clone https://git.martin-wiesinger.at/LGB_Salzburg/bash.git bash-config
cd bash-config
bash install.sh
source ~/.bashrc
For updates, run git pull --ff-only and then bash install.sh in the checkout.
Without arguments, the installer uses the adjacent bashrc_custom file when
present, otherwise it downloads from the configured Forgejo URL.
Customize and undo
After editing bashrc_custom or install.sh, regenerate the checksums:
bash update-checksums.sh
Commit and push the changed files and their .sha256 files together. Keep machine-specific
settings in that machine's ~/.bashrc. Only add settings suitable for sharing;
do not put passwords or tokens in the hosted file.
Existing configuration is backed up to ~/.bashrc_custom.bak on replacement;
~/.bashrc.bak is created when the installer adds the source line. These are
single backups and can be overwritten by subsequent installs.
To uninstall, remove the custom managed configuration comment and source line
from ~/.bashrc, then delete ~/.bashrc_custom. Changes already loaded into a
running shell last until that shell exits.
This setup uses interactive Bash's ~/.bashrc. If a login shell does not load it,
ensure your existing ~/.bash_profile (or applicable login startup file) sources
~/.bashrc.