Skip to content

Commit 4aa4d8f

Browse files
committed
fix some bugs
1 parent 15e7dc8 commit 4aa4d8f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

runitctl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ success() { echo -e "${GREEN}${1}${RESET}"; }
1313
warn() { echo -e "${YELLOW}${1}${RESET}"; }
1414
error() { echo -e "${RED}${1}${RESET}"; }
1515

16+
if [ "$EUID" -ne 0 ]; then
17+
echo -e "This command requires root privileges. Try: ${GREEN}sudo runitctl $*${RESET}"
18+
exit 1
19+
fi
20+
1621
# Check if at least one argument is provided
1722
if [ $# -lt 1 ]; then
18-
echo "Usage: runitctl ${GREEN}<action>${GREEN} [service]"
23+
echo -e "Usage: runitctl ${GREEN}<action>${RESET} ${YELLOW}[service]${RESET}"
1924
exit 1
2025
fi
2126

0 commit comments

Comments
 (0)