Closed ThomDietrich closed 6 years ago
We could do sth like:
SessionCount="$(who | cut -d' ' -f1,12 | tr ' ' @ | tr '\n' ',' | tr -d '()' | rev | cut -c 2- | rev)"
if ! ContainsValidIp $SessionCount ; then
SessionCount="$(who | cut -d' ' -f1,13 | tr ' ' @ | tr '\n' ',' | tr -d '()' | rev | cut -c 2- | rev)"
fi
if ! ContainsValidIp $SessionCount ; then
SessionCount="$(who | grep -c "$USER") sessions"
fi
Seems it doesn't work properly on Centos 6 too. Looking into it. Seems like the cut needs f1,16 for CentOS 6... Will test and update this soon
Reverted this change for now, made a test function. This is getting more complicated then I thought. Although it is a nice to have it will have to wait for some other changes.
Tested and working on RPi. Issue can be closed if you are seeing good results on Centos ;)
Is it resolved?
For me it works fine, so I'm closing this for now. If it gives issues for you, let me know and I'll reopen.
This is related to the last two commits. I'm currently just seeing
I'll provide a PR as soon as I found the time to look into this.