From 5710f98224ac73108e4769f4f1c0ba31da567090 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Mon, 18 May 2026 15:45:06 -0600 Subject: [PATCH] wooo --- customscripts/princess-pi-broadcast-system | 10 ++--- ...tem (# Edit conflict 2026-05-18 ls59pgC #) | 44 +++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 customscripts/princess-pi-broadcast-system (# Edit conflict 2026-05-18 ls59pgC #) diff --git a/customscripts/princess-pi-broadcast-system b/customscripts/princess-pi-broadcast-system index 8afa5f3..afc50c2 100644 --- a/customscripts/princess-pi-broadcast-system +++ b/customscripts/princess-pi-broadcast-system @@ -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" \ No newline at end of file +sudo broadcast_important_princess_message "$msg" \ No newline at end of file diff --git a/customscripts/princess-pi-broadcast-system (# Edit conflict 2026-05-18 ls59pgC #) b/customscripts/princess-pi-broadcast-system (# Edit conflict 2026-05-18 ls59pgC #) new file mode 100644 index 0000000..7ecf388 --- /dev/null +++ b/customscripts/princess-pi-broadcast-system (# Edit conflict 2026-05-18 ls59pgC #) @@ -0,0 +1,44 @@ +#!/bin/bash +if [ -z "$1" ]; then + msg="SHIT'S GOIN ON RN" +else + msg="$1" +fi + +broadcast_important_princess_message () { + # Check if a message was provided + if [ -z "$1" ]; then + 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: fuckyou dis shit needs root FAIL" >&2 + return 1 + fi + + local message="$1" + local timestamp + timestamp=$(date +"%H:%M:%S") + + echo "Broadcasting message to all active terminals..." + + # Loop through all numeric entries in /dev/pts/ + for pty in /dev/pts/[0-9]*; do + # Ensure it's an actual character device file before writing + if [ -c "$pty" ]; then + # Send the message with a clear broadcast banner + { + echo -e "\033[31m" + echo -e "=== PRINCESS BROADCAST SYSTEM ($timestamp) ===" + echo -e "$message" + echo -e "=====================================" + echo -e "\e[0m" + } > "$pty" 2>/dev/null + fi + done +} + +# needz root to write to other peoplez ptys +sudo broadcast_important_princess_message "$msg" \ No newline at end of file