mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-02-19 12:41:05 +00:00
fix: Escape special characters in motd script
This commit is contained in:
parent
ea5090e672
commit
7ed7e7fe73
@ -1,9 +1,16 @@
|
||||
#!/usr/bin/bash
|
||||
escape() {
|
||||
sed 's/[&/\]/\\&/g' <<< "$1"
|
||||
}
|
||||
|
||||
TIP_FILE=$(ls "/usr/share/ublue-os/motd/tips/"*".md" | shuf -n 1)
|
||||
if [[ -f "$TIP_FILE" ]]; then
|
||||
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
|
||||
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
|
||||
IMAGE_NAME_ESCAPED=$(escape "$IMAGE_NAME")
|
||||
IMAGE_TAG=$(jq -r '."image-tag"' < $IMAGE_INFO)
|
||||
IMAGE_TAG_ESCAPED=$(escape "$IMAGE_TAG")
|
||||
TIP=$(shuf -n 1 "$TIP_FILE")
|
||||
sed -e "s/%IMAGE_NAME%/$IMAGE_NAME/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG/g" -e "s/%TIP%/$TIP/g" /usr/share/ublue-os/motd/bazzite.md | /usr/bin/glow -s auto -
|
||||
TIP_ESCAPED=$(escape "$TIP")
|
||||
sed -e "s/%IMAGE_NAME%/$IMAGE_NAME_ESCAPED/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG_ESCAPED/g" -e "s/%TIP%/$TIP_ESCAPED/g" /usr/share/ublue-os/motd/bazzite.md | /usr/bin/glow -s auto -
|
||||
fi
|
@ -7,7 +7,7 @@
|
||||
| `ujust toggle-user-motd` | Toggle this banner on/off |
|
||||
| `neofetch` | View system information |
|
||||
|
||||
*%TIP%*
|
||||
%TIP%
|
||||
- [ Report an issue](https://github.com/ublue-os/bazzite/issues)
|
||||
- [ Discord](https://discord.bazzite.gg/)
|
||||
- [ Documentation](http://docs.bazzite.gg/)
|
@ -1,5 +1,5 @@
|
||||
It is **always** better to install packages with Distrobox than to layer them with rpm-ostree. `ujust distrobox` makes it easy!
|
||||
Packages installed in Distrobox can be exported to appear like any other application ([View documentation](https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-export.md)).
|
||||
Update break something? You can roll back and pin the previous release or rebase by build date ([View our guide](https://universal-blue.discourse.group/docs?topic=513)).
|
||||
Packages installed in Distrobox can be exported to appear like any other application - [View documentation](https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-export.md).
|
||||
Update break something? You can roll back and pin the previous release or rebase by build date - [View our guide](https://universal-blue.discourse.group/docs?topic=513).
|
||||
Installing a non-Steam Windows game? Lutris is pre-installed for better handling of wine prefixes.
|
||||
BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS ([More info here](https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows)).
|
||||
BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS - [More info here](https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows).
|
Loading…
x
Reference in New Issue
Block a user