1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grafana_ynh.git synced 2024-09-03 20:36:29 +02:00
grafana_ynh/scripts/_common.sh

23 lines
473 B
Bash
Raw Normal View History

2017-02-18 16:45:43 +01:00
#!/bin/bash
#
# Common variables
#
INFLUXDB_REPOSITORY="/etc/apt/sources.list.d/influxdb.list"
GRAFANA_REPOSITORY="/etc/apt/sources.list.d/grafana_stable.list"
#
# Common helpers
#
# Fix path if needed
# usage: fix_patch PATH_TO_FIX
fix_path() {
local path=$1
if [ "${path:0:1}" != "/" ] && [ ${#path} -gt 0 ]; then
path="/$path"
fi
if [ "${path:${#path}-1}" == "/" ] && [ ${#path} -gt 1 ]; then
path="${path:0:${#path}-1}"
fi
echo "$path"
}