#!/bin/sh
# @file cpsudo_chrome_sandbox_secure
# @brief fix permission of a just downloaded chrome version
# @description Chrome requires the chrome-sandbox file to be owned by root
#   /opt/3genlabs/hawk/syntheticnode/service/chrome/TempPendingChrome/ is deleted immediately before the unzip and running of this script
#   TODO: Install Chrome versions as root to avoid needing this

# path to the just donloaded file to fix
temp_chrome_sandbox_path='/opt/3genlabs/hawk/syntheticnode/service/chrome/TempPendingChrome/chrome-sandbox'

    # 4755 is "-rwsr-xr-x"
if chown root:root ${temp_chrome_sandbox_path} && chmod 04755 ${temp_chrome_sandbox_path}; then
    echo "true"
else
    echo "false"
fi