Skip to content
Snippets Groups Projects
Commit 58d1b6e1 authored by Bob Mottram's avatar Bob Mottram
Browse files

Restoring blog directory

parent a3ebf299
No related branches found
No related tags found
No related merge requests found
......@@ -42,14 +42,14 @@ HTMLY_TITLE="My Htmly"
HTMLY_SUBTITLE="Another ${PROJECT_NAME} Htmly"
htmly_variables=(HTMLY_REPO
HTMLY_COMMIT
HTMLY_DOMAIN_NAME
HTMLY_CODE
HTMLY_TITLE
HTMLY_SUBTITLE
ONION_ONLY
DDNS_PROVIDER
MY_USERNAME)
HTMLY_COMMIT
HTMLY_DOMAIN_NAME
HTMLY_CODE
HTMLY_TITLE
HTMLY_SUBTITLE
ONION_ONLY
DDNS_PROVIDER
MY_USERNAME)
function set_avatar_from_url {
AVATAR="$1"
......@@ -228,14 +228,17 @@ function restore_local_htmly {
temp_restore_dir=/root/temphtmly
restore_directory_from_usb $temp_restore_dir blog
restore_directory_from_usb $temp_restore_dir htmly
rm -rf /var/www/${HTMLY_DOMAIN_NAME}/htdocs
cp -r $temp_restore_dir/var/www/${HTMLY_DOMAIN_NAME}/htdocs /var/www/${HTMLY_DOMAIN_NAME}/
if [ -d /var/www/${HTMLY_DOMAIN_NAME}/htdocs ]; then
rm -rf /var/www/${HTMLY_DOMAIN_NAME}/htdocs
fi
temp_source_dir=$(find ${temp_restore_dir} -name htdocs | sed 's/\.//g')
cp -r ${temp_restore_dir}${temp_source_dir} /var/www/${HTMLY_DOMAIN_NAME}/
if [ ! "$?" = "0" ]; then
set_user_permissions
backup_unmount_drive
exit 593
fi
rm -rf $temp_restore_dir
rm -rf ${temp_restore_dir}
if [ ! -d /var/www/${HTMLY_DOMAIN_NAME}/htdocs/content ]; then
echo $"No content directory found after restoring htmly"
set_user_permissions
......@@ -285,12 +288,15 @@ function restore_remote_htmly {
mkdir $temp_restore_dir
function_check restore_directory_from_friend
restore_directory_from_friend $temp_restore_dir htmly
rm -rf /var/www/${HTMLY_DOMAIN_NAME}/htdocs
cp -r $temp_restore_dir/var/www/${HTMLY_DOMAIN_NAME}/htdocs /var/www/${HTMLY_DOMAIN_NAME}/
if [ -d /var/www/${HTMLY_DOMAIN_NAME}/htdocs ]; then
rm -rf /var/www/${HTMLY_DOMAIN_NAME}/htdocs
fi
temp_source_dir=$(find ${temp_restore_dir} -name htdocs | sed 's/\.//g')
cp -r ${temp_restore_dir}${temp_source_dir} /var/www/${HTMLY_DOMAIN_NAME}/
if [ ! "$?" = "0" ]; then
exit 593
fi
rm -rf $temp_restore_dir
rm -rf ${temp_restore_dir}
if [ ! -d /var/www/${HTMLY_DOMAIN_NAME}/htdocs/content ]; then
echo $"No content directory found after restoring htmly"
exit 287
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment