diff --git a/matrixpack.sh b/matrixpack.sh index 06ab1e42690a7f0feb8943ccd93641d27da2cb27..2a542eec69127fa3febffd2f0b4bf8a3fa1e334b 100755 --- a/matrixpack.sh +++ b/matrixpack.sh @@ -17,31 +17,25 @@ function slugify () { echo "$1" | iconv -c -t ascii//TRANSLIT | sed -E 's/[~^]+//g' | sed -E 's/[^a-zA-Z0-9]+/-/g' | sed -E 's/^-+|-+$//g' | tr A-Z a-z } -# COMMON REQUIRED BINARIES -require convert -require montage -require identify -require python -require curl -require sed -require tr - -# Checking params -if test $# -lt 3 ; then - echo 1>&2 "Fatal: $# invalid argument number (expected 3)" - exit 1 -fi - # Display usage funtion display_usage (){ echo -e "\nUsage : ./matrixpack.sh token homeserver directory\n" } -# Erase http:// or https:// if added in the homeserver +# Erase http:// or https:// if added in the homeserver slug_homeserver() { echo "$1" | iconv -c -t ascii//TRANSLIT | sed -E 's/^http:\/\/|^https:\/\///g' | sed -E 's/^-+|-+$//g' } +# COMMON REQUIRED BINARIES +require convert +require montage +require identify +require python +require curl +require sed +require tr + # Checking params if test $# -lt 3 ; then echo 1>&2 "$0:FATAL: invalid argument number (expected 3)"