-
Notifications
You must be signed in to change notification settings - Fork 47
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
2 changed files
with
34 additions
and
1 deletion.
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
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,30 @@ | ||
#!/bin/bash | ||
|
||
#get shimboot version | ||
if [ -f "/bootloader/opt/.shimboot_version" ]; then | ||
shimboot_version="$(cat /bootloader/opt/.shimboot_version)" | ||
if [ -f "/bootloader/opt/.shimboot_version_dev" ]; then | ||
shimboot_version+="-dev-$(cat /bootloader/opt/.shimboot_version_dev)" | ||
fi | ||
fi | ||
|
||
#get storage stats | ||
percent_full="$(df -BM / | tail -n1 | awk '{print $5}' | tr -d '%')" | ||
total_size="$(df -BM / | tail -n1 | awk '{print $2}' | tr -d 'M')" | ||
|
||
#print the greeter | ||
if [ "$shimboot_version" ]; then | ||
echo "Welcome to the Shimboot Linux shell. (${shimboot_version})" | ||
else | ||
echo "Welcome to the Shimboot Linux shell." | ||
fi | ||
echo "For documentation and to report bugs, please visit the project's Github page:" | ||
echo " - https://github.com/ading2210/shimboot" | ||
|
||
#a rootfs under 7GB should mean that it is not yet expanded | ||
if [ "$percent_full" -gt 80 ] && [ "$total_size" -lt 7000 ]; then | ||
echo | ||
echo "Warning: Your storage is nearly full and you have not yet expanded the root filesystem. Run 'sudo expand_rootfs' to fix this." | ||
fi | ||
|
||
echo |