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

Move files rather than deleting them

parent b049d8ba
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ setup_file="$webadmin_install_dir/setup.txt"
domain_file="$webadmin_install_dir/.temp_domain.txt"
pending_removes="$webadmin_install_dir/pending_removes.txt"
pending_installs="$webadmin_install_dir/pending_installs.txt"
INSTALL_DIR=/root/build
while true
do
......@@ -145,6 +146,11 @@ do
rm "$domain_file"
fi
if [ -d "$INSTALL_DIR/tempwebadmin" ]; then
mv "$INSTALL_DIR/tempwebadmin"/* "$webadmin_install_dir"
rm -rf "$INSTALL_DIR/tempwebadmin"
fi
# restart the web server
systemctl restart nginx
fi
......
......@@ -95,7 +95,10 @@ function web_admin_create_users {
if [ -f "$users_file" ]; then
rm "$users_file"
fi
rm "$webadmin_install_dir/userprofile_"*.html
if [ ! -d "$INSTALL_DIR/tempwebadmin" ]; then
mkdir -p "$INSTALL_DIR/tempwebadmin"
fi
mv "$webadmin_install_dir/userprofile_"*.html "$INSTALL_DIR/tempwebadmin"
return
fi
......@@ -175,7 +178,10 @@ function web_admin_create_add_apps {
if [ -f "$appslist_add_filename" ]; then
rm "$appslist_add_filename"
fi
rm "$webadmin_install_dir/app_add_"*.html
if [ ! -d "$INSTALL_DIR/tempwebadmin" ]; then
mkdir -p "$INSTALL_DIR/tempwebadmin"
fi
mv "$webadmin_install_dir/app_add_"*.html "$INSTALL_DIR/tempwebadmin"
return
fi
......@@ -332,7 +338,10 @@ function web_admin_create_installed_apps {
if [ -f "$appslist_filename" ]; then
rm "$appslist_filename"
fi
rm "$webadmin_install_dir/app_"*.html
if [ ! -d "$INSTALL_DIR/tempwebadmin" ]; then
mkdir -p "$INSTALL_DIR/tempwebadmin"
fi
mv "$webadmin_install_dir/app_"*.html "$INSTALL_DIR/tempwebadmin"
return
fi
......
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