Reboot Reminder In Arch Linux

Search for a command to run...

No comments yet. Be the first to comment.
Most AI agents that support scheduled tasks have two sources of instruction when a cron job fires: The cron prompt — the task-specific instructions you wrote when scheduling the job The skill — a re

TL;DR Scarp draw result, host on GitHub, retrieve it like API at damacai.hongineer.com. Data Scraping I have previously shared a technique for scraping Da Ma Cai draw result. Now I finally have time t

This is a Bash script that check if the replica (slave) health status. If there is an issue, it will exist with non-zero status. This is useful when used with monitoring tools like [Monit](https://mmo

chmod is a command-line utility used to change the access permissions of file system objects such as files and directories. It allows you to control who can read, write, and execute those objects. Changing Permissions Using Octal Notation Example Usa...
chown changes the ownership of files and directories. This involves modifying the user and/or group associated with a file, determining who has access and permissions. Changing File Ownership to a Specific User Example Usage: chown user file.txt What...
Reboot is required when Linux kernel is updated. Ubuntu has a nice MOTD that reminds user to reboot the machine. There is a simple implementation for Arch Linux.
Append the following to end of ~/.bashrc:
versionUpdated=$(vercmp $(pacman -Q linux | cut -d " " -f 2) $(uname -r))
if [ $versionUpdated -ne 0 ]; then
HIGHLIGHT='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${HIGHLIGHT}Linux version changed, reboot needed.${NC}"
fi
I am using pacman -Q linux | cut -d " " -f 2 to extract installed kernel version. If you are using other distro, you will need to modify this part. vercmp is also Arch-specific command.
I am using non-zero (-ne) comparison, so it will display reminder message whenever there is changes in kernel version (both upgrade and downgrade). Font color is yellow, you can change it to a different color.
Reference: https://bbs.archlinux.org/viewtopic.php?id=173508