if boolean_is_true "$LOCAL_APPS"; then
    # Copy back passwd and group
    for i in passwd group; do
        [ -e "${LOCALAPPS_CACHE}/${i}" ] && cp "${LOCALAPPS_CACHE}/${i}" /etc/${i}
    done

    # Clean up cups config
    [ -r "/etc/cups/client.conf" ] && rm -f /etc/cups/client.conf

    # Clean up localapps menu
    if boolean_is_true "$LOCAL_APPS_MENU" && [ -n "${TMP_XDG_MENU}" ]; then
        if [ -S ${LDM_SOCKET} ]; then
            ssh -S ${LDM_SOCKET} ${LDM_SERVER} rm -rf "${TMP_XDG_MENU}"
        fi
    fi

    # Unmount sshfs and remove the mount dir
    fusermount -uqz ${LDM_HOME}
    rmdir ${LDM_HOME}

    # Unmount other mounts
    if [ -n "${LOCAL_APPS_EXTRAMOUNTS}" ]; then
        OLDIFS="$IFS"
        IFS=','
        for extradir in ${LOCAL_APPS_EXTRAMOUNTS}; do
            fusermount -uqz "${extradir}"
            rmdir "${extradir}"
        done
        IFS="$OLDIFS"
    fi

    rm $LOCALAPPSD_PIDFILE
fi
