The original user is not detected properly whn multiple users are logged in. This fix gets the first logged in user.

This commit is contained in:
Ivan Davidov 2017-12-22 01:02:20 +02:00
parent 6f3e5ba201
commit 41f7110d7a

View File

@ -12,7 +12,7 @@ if [ "$(id -u)" = "0" ] ; then
echo "Applying original ownership to all affected files. This may take a while." echo "Applying original ownership to all affected files. This may take a while."
# Find the original user. Note that this may not always be correct. # Find the original user. Note that this may not always be correct.
ORIG_USER=`who | awk '{print \$1}'` ORIG_USER=`who | head -n 1 | awk '{print \$1}'`
echo "Original user is '$ORIG_USER'." echo "Original user is '$ORIG_USER'."
# Apply ownership back to original owner for all affected files. # Apply ownership back to original owner for all affected files.