Skip to content

Commit

Permalink
manage-install.sh: Unmount the overlays again
Browse files Browse the repository at this point in the history
This (maybe?) fixes #18. Let me know if it doesn't.
  • Loading branch information
ValShaped committed Feb 5, 2023
1 parent edf619b commit 1d7e09d
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions rwfus_include/manage-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ function perform_install {
Log -p echo "Creating overlays for $cf_Directories:"

if list_service > /dev/null; then
Log -p echo "0. Disabling service"
config load
service disable "$cf_Service_Directory"
Log echo "# It's okay if unmounting fails here #"
Log Test unmount_all
fi

# generate dirs
Expand Down Expand Up @@ -94,6 +98,8 @@ function perform_update {
# disable units
Log -p echo "1. Disabling service"
service disable "$cf_Service_Directory"
Log echo "# It's okay if unmounting fails here #"
Log Test unmount_all

# delete units
Log -p echo "2. Removing service"
Expand All @@ -114,7 +120,7 @@ function perform_update {

# enable units
Log -p echo "6. Enabling service"
enable_service "$cf_Service_Directory"
service enable "$cf_Service_Directory"
Log -p echo -e "Done!\n"
}

Expand Down Expand Up @@ -147,7 +153,9 @@ function perform_remove_all {

# disable units
Log -p echo "1. Disabling units"
disable_service "$cf_Service_Directory"
service disable "$cf_Service_Directory"
Log echo "# It's okay if unmounting fails here #"
Log Test unmount_all

Log -p echo "2. Removing units"
remove_service "$cf_Service_Directory"
Expand All @@ -167,7 +175,9 @@ function add_to_bin {
if stat_service > /dev/null; then
local reenable=true
Log -p echo "Stopping $Name"
disable_service
service disable
Log echo "# It's okay if unmounting fails here #"
Log Test unmount_all
fi
Log -p echo "Adding $Name to $bin_dir"
# Move sources to the bin dir
Expand All @@ -182,7 +192,7 @@ function add_to_bin {
# shellcheck disable=2086
if [ $reenable ]; then
Log -p echo "Restarting $Name"
enable_service
service enable
fi

Log -p echo -e "Done!\n"
Expand All @@ -194,7 +204,9 @@ function remove_from_bin {
if stat_service > /dev/null; then
reenable=true
Log -p echo "Stopping $Name"
disable_service
service disable
Log echo "# It's okay if unmounting fails here #"
Log Test unmount_all
fi
Log -p echo "Removing $Name from $bin_dir"
if (Log rm -vr "$bin_dir/rwfus_include" && Log rm -v "$bin_dir/$(basename "$0")"); then
Expand All @@ -205,7 +217,7 @@ function remove_from_bin {

if $reenable; then
Log -p echo "Restarting $Name"
enable_service
service enable
fi
Log -p echo -e "Done!\n"
}

0 comments on commit 1d7e09d

Please sign in to comment.