Révision 8550e097
Ajouté par Julien Enselme il y a plus de 9 ans
bin/scripts-utils.sh | ||
---|---|---|
36 | 36 |
fi |
37 | 37 |
|
38 | 38 |
while echo "$site_password" | grep -Fq '/' ; do |
39 |
site_password="$(dd if=/dev/random count=1 | uuencode -m - | head -n 2 | tail -n 1 | cut -c-"${password_length}")"
|
|
39 |
site_password=$(dd if=/dev/random count=1 | uuencode -m - | head -n 2 | tail -n 1 | cut -c-"${password_length}")
|
|
40 | 40 |
done |
41 | 41 |
|
42 | 42 |
echo "$site_password" |
... | ... | |
63 | 63 |
give_dir() { |
64 | 64 |
# ARG: file |
65 | 65 |
# Return the abosulte directory path of a file or a dir. |
66 |
settings_location="$(realpath "$1")"
|
|
67 |
echo "$(dirname "${settings_location}")"
|
|
66 |
settings_location=$(realpath "$1")
|
|
67 |
echo $(dirname "${settings_location}")
|
|
68 | 68 |
} |
69 | 69 |
|
70 | 70 |
work_tree_clean() { |
71 |
git_status_output="$(git status --porcelain)"
|
|
71 |
git_status_output=$(git status --porcelain)
|
|
72 | 72 |
if [ -z "${git_status_output}" ] ; then |
73 | 73 |
return 0 |
74 | 74 |
else |
... | ... | |
77 | 77 |
} |
78 | 78 |
|
79 | 79 |
mail_unclean_work_tree() { |
80 |
cd "$dir_multi_assos"
|
|
81 |
git_status_output="$(git status)"
|
|
80 |
cd "${dir_multi_assos}"
|
|
81 |
git_status_output=$(git status)
|
|
82 | 82 |
echo "${git_status_output}" | mail -s "$1" "${email_multi_assos}" |
83 | 83 |
} |
84 | 84 |
|
Formats disponibles : Unified diff
Command subsitution are not quoted. Quotes posed problems in loop.