Commit 23909d15 authored by Pierre-Yves Fourmond's avatar Pierre-Yves Fourmond

Issue #33 - Handle .liar_software file installation and automatic upgrade -...

Issue #33 - Handle .liar_software file installation and automatic upgrade - Fixed upgrade in super user mode
parent b7efa70b
......@@ -776,8 +776,20 @@ liar_upgrade() {
return 1
fi
if [ "$LIAR_SOFTWARE_FILE" != "custom" ] && ! upgrade .liar_software "$HOME"; then
return 1
if [ "$LIAR_SOFTWARE_FILE" != "custom" ]; then
if [ -n "$SUDO_USER" ]; then
home=$(grep $SUDO_USER /etc/passwd | cut -d ":" -f 6)
else
home="$HOME"
fi
if ! upgrade .liar_software "$home"; then
return 1
fi
if [ -n "$SUDO_USER" ]; then
chown $SUDO_USER:$SUDO_USER $home/.liar_software
fi
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment