#!/bin/sh add_entry() { local profile="$1" local line='source /etc/profile.env' grep -q "^${line}"'$' "${profile}" || { cp "${profile}" "${profile}.new" && \ echo >>"${profile}.new" && \ echo "${line}" >>"${profile}.new" && \ echo 'export XDG_DATA_DIRS' >>"${profile}.new" && \ mv "${profile}.new" "${profile}" } } #add_entry "/etc/profile" grep -q 'source /etc/profile.env' /etc/osso-af-init/af-defines.sh || { sed 's;source_if_is keyboard.defs;source_if_is keyboard.defs\ source /etc/profile.env;' /etc/osso-af-init/af-defines.sh >/etc/osso-af-init/af-defines.sh.new && mv /etc/osso-af-init/af-defines.sh.new /etc/osso-af-init/af-defines.sh } touch /etc/profile.env mkdir -p /opt/share/mime/packages