diff --git a/web_interface/html/bashscripts/updatewebinterface.sh b/web_interface/html/bashscripts/updatewebinterface.sh new file mode 100755 index 0000000000000000000000000000000000000000..563f1a2495756b45554ecf5dbb3650012c542d71 --- /dev/null +++ b/web_interface/html/bashscripts/updatewebinterface.sh @@ -0,0 +1,126 @@ +#!/bin/bash +# +# Inform the user +echo "Now starting the \"updatewebinterface.sh\" shell script" +echo "" +# +# Put the web home as a variable +wwwhome="/var/www/html" +# +# Put the dfall home as a variable +dfallhome="/home/www-share/dfall/dfall-system/web_interface/html" +# +# Inform the user of the directories +echo "Using the following directories:" +echo ">> wwwhome = $wwwhome" +echo ">> dfallhome = $dfallhome" +echo "" +# +# Change directory to the web home +cd $wwwhome +echo "Changed directory to $wwwhome" +echo "" +# +# +# +# REMOVE the contents of the js folder +rm -v js/*.js +echo "Removed the \"*.js\" contents of the \"js\" folder" +rm -v js/* +echo "Removed any other contents of the \"js\" folder" +rmdir -v js +echo "Removed the \"js\" folder" +echo "" +# +# Make the javacript folder again +mkdir -v js +echo "Remade the \"js\" folder" +# Copy the javscripts files +cp -v $dfallhome"/js/"*.js $wwwhome"/js/" +echo "Copied across the \"js\" folder contents" +echo "" +# +# +# +# REMOVE the contents of the img folder +rm -v img/*.* +echo "Removed the \"*.*\" contents of the \"img\" folder" +rm -v img/* +echo "Removed any other contents of the \"img\" folder" +rmdir -v img +echo "Removed the \"img\" folder" +echo "" +# +# Make the img folder again +mkdir -v img +echo "Remade the \"img\" folder" +# Copy the img files +cp -v $dfallhome"/img/"*.* $wwwhome"/img/" +echo "Copied across the \"img\" folder contents" +echo "" +# +# +# +# REMOVE the contents of the css folder +rm -v css/*.css +echo "Removed the \"*.css\" contents of the \"css\" folder" +rm -v css/* +echo "Removed any other contents of the \"css\" folder" +rmdir -v css +echo "Removed the \"css\" folder" +echo "" +# +# Make the img folder again +mkdir -v css +echo "Remade the \"css\" folder" +# Copy the img files +cp -v $dfallhome"/css/"*.css $wwwhome"/css/" +echo "Copied across the \"css\" folder contents" +echo "" +# +# +# +# REMOVE the contents of the bashscripts folder +rm -v bashscripts/*.sh +echo "Removed all the contents of the \"bashscripts\" folder" +echo "" +# +# Change directory to the web home +cd $wwwhome +echo "Changed directory back to $wwwhome" +# Copy the bashscript files +cp -v $dfallhome"/bashscripts/"*.sh $wwwhome"/bashscripts/" +echo "Copied across the \"bashscripts\" folder contents" +echo "" +# +# +# +# Remove the "uploads" folder, if it exists +rm -v uploads/* +echo "Removed all contents of the \"uploads\" folder" +rmdir -v uploads +echo "Removed the \"uploads\" folder" +echo "" +# +# Make the uploads folder again +mkdir -v uploads +echo "Remade the \"uploads\" folder" +echo "" +# +# +# +# REMOVE the contents of the wwwhome folder +rm -v *.php +rm -v *.html +rm -v *.* +echo "Removed all the contents of the \"wwwhome\" folder" +echo "" +# +# Copy the html files +cp -v $dfallhome"/"*.html $wwwhome"/" +echo "Copied across the \"*.html\" files" +echo "" +# Copy the php files +cp -v $dfallhome"/"*.php $wwwhome"/" +echo "Copied across the \"*.php\" files" +echo ""