Remaniement : réécriture du script pour monter mon téléphone

This commit is contained in:
Hippolyte Chauvin 2023-05-20 12:47:00 +02:00
parent 750b1aa541
commit 2d826f60bc

View file

@ -1,24 +1,17 @@
#!/bin/bash #!/bin/sh
# Variable # Variable
if [ -n "$1" ]; then
dest="$1"
shift
else
dest=/mnt/ahurac/phone dest=/mnt/ahurac/phone
fi
# Commands building
# Create destination
create_destination=(
mkdir
-p
"$dest"
)
# Mount phone
mount_phone=(
aft-mtp-mount
"$dest"
)
# Execution # Execution
set -xe set -xe
"${create_destination[@]}" mkdir -p "$dest"
"${mount_phone[@]}" aft-mtp-mount "$dest"
set +x
echo "Mounted on: \"${dest}\""