Ensure tobiko.log is writable.

Change-Id: Ie12cb3be8f24a9bd24bae28d4a87b9661aaab1df
This commit is contained in:
Federico Ressi 2019-12-03 17:13:06 +01:00
parent 0b93f34b72
commit b2c1698245
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,16 @@ function install_tobiko {
function configure_tobiko {
# Ensure any user can write to log file
local log_dir=$(dirname ${TOBIKO_LOG_FILE})
if ! [ -d "${log_dir}" ]; then
sudo mkdir -p "${log_dir}"
fi
if ! [ -w "${TOBIKO_LOG_FILE}" ]; then
sudo touch "${TOBIKO_LOG_FILE}"
sudo chmod ugo+rw "${TOBIKO_LOG_FILE}"
fi
# Write configuration to a new temporary file
local tobiko_conf_file=$(mktemp)
if [ -f "${TOBIKO_CONF_FILE}" ]; then