Project

General

Profile

Feature #16803 » usr-local-arvados-ensure-.config-dir.sh.erb

Ward Vandewege, 09/02/2020 05:13 PM

 
#!/bin/bash

###################################################################
# THIS FILE IS MANAGED BY PUPPET -- CHANGES WILL BE OVERWRITTEN #
###################################################################

# This script is called from the install-arvados-tokens.rb script
# on the Arvados controller for this cluster.

USERNAME=$1

if [[ "$USERNAME" == "" ]]; then
echo "Syntax: $0 username"
exit 1
fi

id $1 >/dev/null

if [[ "$?" == "0" ]]; then
HOMEDIR=`eval echo ~$USERNAME`
ls $HOMEDIR/.config/arvados/settings.conf >/dev/null 2>&1
if [[ "$?" != "0" ]]; then
echo "$HOMEDIR/.config/arvados/settings.conf does not exist"
if [[ ! -e $HOMEDIR/.config/arvados ]]; then
mkdir -p $HOMEDIR/.config/arvados
fi
chmod 700 $HOMEDIR/.config
chmod 700 $HOMEDIR/.config/arvados
chown -R $USERNAME:$USERNAME $HOMEDIR/.config
fi
fi
(2-2/2)