diff --git a/install/README.md b/install/README.md index ec01dca..71797a4 100644 --- a/install/README.md +++ b/install/README.md @@ -13,12 +13,17 @@ Run `📄 install.sh` to setup [`📂 .bashrc.d`](../.bashrc.d/), create various configuration file symlinks, and make some further [configuration changes](#configuration-changes). -`📄 install.sh` Runs all executable files in [`📂 install/parts.d`](./parts.d/). -To enable/disable parts of the installation, simply `chmod +x/-x` the scripts in +`📄 install.sh` Runs all executable files in [`📂 parts.d`](./parts.d/). To +enable/disable parts of the installation, simply `chmod +x/-x` the scripts in question prior to running the installer. -The scripts in `📂 install/parts.d` are idempotent. They can be run multiple -times on an already "installed" system without nasty side-effects. +It is possible to run a _single_ part by using `install.sh ` (e.g. +`install.sh 20-home` would execute [`📄 parts.d/20-home`](./parts.d/20-home)). +This is the preferred way of running single parts on-demand – most of them +depend on variables set by `install.sh` and thus cannot be run directly. + +The scripts in `📂 parts.d` are idempotent. They can be run multiple times on an +already "installed" system without nasty side-effects. During installation, `📄 ~/.env` is created from [a defaults file](./../.env.default) which lists all possible environment @@ -53,7 +58,6 @@ To pull down a non-predefined version of the tool, do: ```shell version=v1.24 ./powerline-go - ``` ### Configuration changes diff --git a/install/install.sh b/install/install.sh index 9b3f433..9c4b01b 100755 --- a/install/install.sh +++ b/install/install.sh @@ -8,8 +8,10 @@ base=$(dirname "$(realpath "$(dirname "${BASH_SOURCE[0]}")")") for file in "$base"/install/parts.d/**; do - if [[ -x "$file" ]]; then - echo Installing 📄 "$(basename "$file")"... + file_basename="$(basename "$file")" + + if [[ -x $file && (! -v 1 || $1 == "$file_basename") ]]; then + echo Installing 📄 "$file_basename"... source "$file" fi diff --git a/install/parts.d/90-motd b/install/parts.d/90-motd index e03b19e..feefc45 100755 --- a/install/parts.d/90-motd +++ b/install/parts.d/90-motd @@ -1,7 +1,13 @@ #!/usr/bin/env bash sudo chmod --silent -x /etc/update-motd.d/10-help-text || true -sudo chmod --silent -x /etc/update-motd.d/50-landscape-sysinfo || true + +landscape_sysinfo=/etc/update-motd.d/50-landscape-sysinfo +if [ -L "$landscape_sysinfo" ]; then + sudo rm "$landscape_sysinfo" +elif [ -f "$landscape_sysinfo" ]; then + sudo chmod --silent -x "$landscape_sysinfo" +fi if systemctl list-unit-files motd-news.service &> /dev/null; then sudo systemctl mask motd-news.service || true