Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
add back in needed function
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavybullets8 committed Aug 19, 2023
1 parent 3570a71 commit 61b2166
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions functions/pvc/mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ pvc_mount_all_in_namespace() {
fi
done

echo -e "${bold}──────────────────────────────────────────────${reset}"
echo -e "${bold}To Unmount All at Once:${reset}"
echo -e "\n${bold}To Unmount All at Once:${reset}"
echo -e "${blue}heavyscript pvc --unmount${reset}\n"
}

Expand Down Expand Up @@ -62,6 +61,27 @@ pvc_select_app() {
done
}

pvc_mount_pvc() {
local app=$1
local data_name=$2
local full_path=$3

if [ ! -d "/mnt/mounted_pvc/$app" ]; then
mkdir "/mnt/mounted_pvc/$app"
fi

if ! zfs set mountpoint="/mounted_pvc/$app/$data_name" "$full_path"; then
echo -e "${bold}PVC:${reset} ${red}$data_name${reset}"
echo -e "${bold}Status:${reset} ${red}Mount Failure${reset}\n"
else
echo -e "${bold}PVC:${reset} ${blue}$data_name${reset}"
echo -e "${bold}Mounted To:${reset} ${blue}/mnt/mounted_pvc/$app/$data_name${reset}"
echo -e "${bold}Status:${reset} ${green}Successfully Mounted${reset}"
echo -e "${bold}To Unmount Manually:${reset}"
echo -e "${blue}zfs set mountpoint=legacy \"$full_path\" && rmdir /mnt/mounted_pvc/$app/$data_name${reset}\n"
fi
}

pvc_stop_selected_app() {
local app=$1

Expand Down

0 comments on commit 61b2166

Please sign in to comment.