Skip to content

Commit

Permalink
change: dedrm script should attempt relative + absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bcliang committed Jun 22, 2022
1 parent 4b95060 commit 2e16f79
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions scripts/dedrm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ KEY_PATH=$2

if [[ -z "$KEY_PATH" ]] || [[ ! -d "$KEY_PATH" ]]
then
if [[ -d "$(pwd)/.adept" ]]
if [[ -d "$(pwd)/$KEY_PATH" ]]
then
KEY_PATH="$(pwd)/.adept"
KEY_PATH="$(pwd)/$KEY_PATH"
else
echo "!!!"
echo "!!! WARNING: no ADEPT keys detected (argument \$2, or \"$(pwd)/.adept\")."
echo "!!! Launching interactive terminal for credentials creation (device activation). Run this:"
echo "!!!"
echo "!!! adept_activate -r --username {USERNAME} --password {PASSWORD} --output-dir files/.adept"
echo "!!!"
echo "!!! (*) use --anonymous in place of --username, --password if you do not have an ADE account."
echo "!!! (*) credentials will be saved in your current path in the folder \"$(pwd)/.adept\""
echo "!!!"

if [[ -d "$(pwd)/.adept" ]]
then
KEY_PATH="$(pwd)/.adept"
else
echo "!!!"
echo "!!! WARNING: no ADEPT keys detected (argument \$2, or \"$(pwd)/.adept\")."
echo "!!! Launching interactive terminal for credentials creation (device activation). Run this:"
echo "!!!"
echo "!!! adept_activate -r --username {USERNAME} --password {PASSWORD} --output-dir files/.adept"
echo "!!!"
echo "!!! (*) use --anonymous in place of --username, --password if you do not have an ADE account."
echo "!!! (*) credentials will be saved in your current path in the folder \"$(pwd)/.adept\""
echo "!!!"
fi
fi
fi

Expand Down Expand Up @@ -45,7 +51,7 @@ else
echo "> adept_remove -v -f \"output.drm\" -o \"/home/libgourou/files/{OUTPUT_FILE}\""
docker run \
-v "$(pwd)":/home/libgourou/files \
-v "$(pwd)/$KEY_PATH":/home/libgourou/.adept \
-v "$KEY_PATH":/home/libgourou/.adept \
--rm bcliang/docker-libgourou \
$ACSM_FILE
fi
Expand Down

0 comments on commit 2e16f79

Please sign in to comment.