27 lines
1.5 KiB
Bash
Executable File
27 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
##########################################################################
|
|
# Shellscript : Set New Teams video backgrounds
|
|
# Autor : Andreas Vogel, NEXT Enterprise gmbh, 2021
|
|
##########################################################################
|
|
##################### Variablen ##########################################
|
|
currentUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
|
|
sourceFiles=/private/tmp/Teams
|
|
MSteamsPath=/Users/"$currentUser"/Library/Application Support/Microsoft/Teams/Backgrounds/Uploads/
|
|
|
|
##################### Check sourceFiles ##################################
|
|
if [ ! -d "$sourceFiles" ]; then
|
|
echo "Missing source files, script will fail, did not display messsage."
|
|
else
|
|
echo "Source files found, script will run."
|
|
fi
|
|
|
|
##################### Run ################################################
|
|
if [ -d "$MSteamsPath" ]; then
|
|
cp /private/tmp/Teams/*.* /Users/"$currentUser"/Library/Application Support/Microsoft/Teams/Backgrounds/Uploads
|
|
chown "$currentUser":wheel /Users/"$currentUser"/Library/Application Support/Microsoft/Teams/Backgrounds/Uploads/*.*
|
|
else
|
|
echo "Path is missing, creating required folders"
|
|
mkdir -p /Users/"$currentUser"/Library/Application Support/Microsoft/Teams/Backgrounds/Uploads
|
|
cp /private/tmp/Teams/*.* /Users/"$currentUser"/Library/Application Support/Microsoft/Teams/Backgrounds/Uploads
|
|
chown "$currentUser":wheel /Users/"$currentUser"/Library/Application Support/Microsoft/Teams/Backgrounds/Uploads/*.*
|
|
fi |