Remaniement : réécriture du script pour monter mon téléphone
This commit is contained in:
parent
750b1aa541
commit
2d826f60bc
1 changed files with 11 additions and 18 deletions
|
@ -1,24 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Variable
|
# Variable
|
||||||
dest=/mnt/ahurac/phone
|
if [ -n "$1" ]; then
|
||||||
|
dest="$1"
|
||||||
# Commands building
|
shift
|
||||||
# Create destination
|
else
|
||||||
create_destination=(
|
dest=/mnt/ahurac/phone
|
||||||
mkdir
|
fi
|
||||||
-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}\""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue