#!/bin/sh -e

current_directory=$(pwd)
directory_name=$(basename "$current_directory")
path_to_modules="/opt/cellframe-node/python/lib/python3.10/site-packages/$directory_name"

command_to_execute="sudo umount $path_to_modules"
if output=$($command_to_execute 2>&1); then
  echo "Directory \"$path_to_modules\" successfully unmounted."
else
  exit_code=$?
  echo "An error occurred while executing the command. Return code: $exit_code"
  echo "$output"
fi
