I have a custom script that needs to be run as root
I have put it in /usr/local/sbin
Where do I configure root's $PATH or make my custom $PATH system wide.
The script itself is not anything special
I just have light sensative eyes that force to wish that I had a very dim screen.
Code:
cat /usr/local/sbin/backlight
#!/bin/sh
MAX=976
MIN=0
SCREEN_BRIGHTNESS=/sys/class/backlight/intel_backlight/brightness
if test $# -gt 1;
then
echo "Usage: backlight [ARGS]" 1>&2
echo "Arguments:" 1>&2
echo "Number between $MIN and $MAX" 1>&2
echo "Options:" 1>&2
echo "-h, --help Print help message" 1>&2
exit 1
fi
if test $# -eq 0
then
cat "$SCREEN_BRIGHTNESS"
exit 0
fi
if test $1 = '-h' -o '--help' = $1
then
echo "This number changes the screen bightness"
echo "Usage: backlight NUMBER"
echo "Number is between $MIN and $MAX"
fi
if test `whoami` != "root"
then
echo "You have to be root to perform this command" 1>&2
exit 3
fi
if test $1 -le $MIN -o $1 -gt $MAX;
then
echo "Numbers must be between $MIN and $MAX" 1>&2
exit 2
fi
sh -c "echo $1 > "$SCREEN_BRIGHTNESS"
If I run it
I get
Code:
sudo: backlight: command not found