Closed dr3mro closed 8 months ago
fix
for user in $display_users; do
if [ $(finger $user | grep -c nologin) -eq 1 ] ; then
su -l $user -c 'env DISPLAY=:0 xhost +local:root' > /dev/null || true
fi
done
Thanks for the report. I'm not clear on how a user with shell set to nologin can have DISPLAY set. Is there some special configuration on your system?
In any case, I added a patch similar to your suggestion, but ensuring that only the shell is checked for nologin rather than all finger output. You can install from https://github.com/outpaddling/freebsd-ports-wip, or just manually grab the battery-shutdown script from this project.
the patch you did need a second thought .. there is a typo you should you fgrep -v
if awk -F : -v user=$user '$1 == user { print $7 }' /etc/passwd | fgrep -v nologin; then
You're right, I had meant to put a ! in there. I think this is more readable than fgrep -v.
in freeBSD 14rc4 there is a bug the /var/log/messages is spamed by the cronjob that launches batteryshutdown.sh
the calibrate is at line 49
fixed in this pull req please accept https://github.com/outpaddling/desktop-installer/pull/33