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
|
||||
dest=/mnt/ahurac/phone
|
||||
|
||||
# Commands building
|
||||
# Create destination
|
||||
create_destination=(
|
||||
mkdir
|
||||
-p
|
||||
"$dest"
|
||||
)
|
||||
|
||||
# Mount phone
|
||||
mount_phone=(
|
||||
aft-mtp-mount
|
||||
"$dest"
|
||||
)
|
||||
if [ -n "$1" ]; then
|
||||
dest="$1"
|
||||
shift
|
||||
else
|
||||
dest=/mnt/ahurac/phone
|
||||
fi
|
||||
|
||||
# Execution
|
||||
set -xe
|
||||
"${create_destination[@]}"
|
||||
"${mount_phone[@]}"
|
||||
mkdir -p "$dest"
|
||||
aft-mtp-mount "$dest"
|
||||
set +x
|
||||
echo "Mounted on: \"${dest}\""
|
||||
|
||||
|
|
Loading…
Reference in a new issue