b5938: check home folder and install if present

This commit is contained in:
Thomas G Stokes committed 2024-01-03 17:42:56 +01:00
1 parent f6f6d007eb
commit 083068ba29
1 file changed
+3 -1
@@ -27,7 +27,9 @@ for dir in $(ls -d */ ); do
cat "$crontab" >> $HOME_DIR/crontab
echo "" >> $HOME_DIR/crontab # Adds a newline
done
cp -r $dir/baseHomeDir/* $HOME_DIR
if [[ -d "${dir}baseHomeDir" ]]; then
cp -r ${dir}baseHomeDir/* $HOME_DIR
fi
sed -i "s|PATH_OF_GIT_HOME_DIR_TO_REPLACE|${GIT_PATH}|g" $HOME_DIR/crontab # Sets correct path to the git repo within the crontab.
sed -i "s|PATH_OF_HOME_DIR_TO_REPLACE|${HOME_DIR}|g" $HOME_DIR/crontab # Sets the correct path to the home dir of the user whose crontab will be installed.
crontab -u ${USERNAME} $HOME_DIR/crontab # Install the crontab in the given user's home dir.