Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
1.2 kB ยท 43 lines
Shell
1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/bin/bash
# Safe daemon starter that handles root permissions properly
echo "๐ Checking user permissions..."
if [ "$EUID" -eq 0 ]; then echo "โ ๏ธ Running as root detected" # Try to find the actual user who should run this REAL_USER=$(who | awk 'NR==1{print $1}') if [ -n "$REAL_USER" ] && [ "$REAL_USER" != "root" ]; then echo "๐ค Found user: $REAL_USER" echo "๐ Switching to user $REAL_USER..." # Run as the real user exec sudo -u "$REAL_USER" "$0" "$@" else echo "โ ๏ธ No non-root user found, running with limited overlay features" echo "๐ง GUI overlays will be disabled due to root permissions" fifi
echo "๐ Starting ac-event-daemon..."
cd "$(dirname "$0")"
# Build the daemonecho "๐จ Building daemon..."cargo build --release
if [ $? -eq 0 ]; then echo "โ
Build successful" echo "๐ต Starting ac-event-daemon..." echo "๐ก Press Ctrl+C to stop, or daemon will auto-stop when terminal closes" echo "" # Run the daemon ./target/release/ac-event-daemonelse echo "โ Build failed" exit 1fi