This commit is contained in:
2026-05-18 15:45:06 -06:00
parent 5a15d4173c
commit 5710f98224
2 changed files with 49 additions and 5 deletions
+5 -5
View File
@@ -5,16 +5,16 @@ else
msg="$1"
fi
broadcast_pty() {
broadcast_important_princess_message () {
# Check if a message was provided
if [ -z "$1" ]; then
echo "Usage: broadcast_pty \"Your message here\"" >&2
echo "Usage: broadcast_important_princess_message \"Princess' Important Message\"" >&2
return 1
fi
# Check for root/sudo privileges (required to write to other users' PTYs)
if [ "$EUID" -ne 0 ]; then
echo "Error: This function must be run as root or with sudo." >&2
echo "Error: fuckyou dis shit needs root FAIL" >&2
return 1
fi
@@ -22,7 +22,7 @@ broadcast_pty() {
local timestamp
timestamp=$(date +"%H:%M:%S")
echo "Broadcasting message to all active terminals..."
echo "Broadcasting message to all ponies~"
# Loop through all numeric entries in /dev/pts/
for pty in /dev/pts/[0-9]*; do
@@ -41,4 +41,4 @@ broadcast_pty() {
}
# needz root to write to other peoplez ptys
sudo broadcast_pty "$msg"
sudo broadcast_important_princess_message "$msg"