init.sh (648B)
1 #!/bin/bash 2 3 # Path to the directory where the repository should be 4 REPO_PATH="/var/www/html/LenaSYS" 5 TEMP_PATH="/var/www/temp" 6 7 # Check if the directory is empty 8 if [ ! "$(ls -A $REPO_PATH)" ]; then 9 echo "Directory is empty. Copying repository into ${REPO_PATH}..." 10 cp -a $TEMP_PATH/.* $REPO_PATH 11 cp -a $TEMP_PATH/* $REPO_PATH 12 chown -R www-data:www-data $REPO_PATH 13 else 14 echo "Repository already exists or directory is not empty." 15 fi 16 17 chown www-data:www-data /var/www/html/coursesyspw.php 18 mkdir /var/www/html/githubMetadata 19 chown -R www-data:www-data /var/www/html/githubMetadata 20 21 # Execute the main container command 22 exec "$@"