From 2d826f60bc7da53fbfd2507142a6bdad44450502 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sat, 20 May 2023 12:47:00 +0200 Subject: [PATCH] =?UTF-8?q?Remaniement=20:=20r=C3=A9=C3=A9criture=20du=20s?= =?UTF-8?q?cript=20pour=20monter=20mon=20t=C3=A9l=C3=A9phone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/mount-phone | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/bin/mount-phone b/bin/mount-phone index 7bbc464..e0e63d6 100755 --- a/bin/mount-phone +++ b/bin/mount-phone @@ -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}\""