Le mirroring des dépôts vers Github est maintenant natif dans Gitlab (et donc Framagit). Merci de passer à la fonction native pour que nous puissions couper notre solution maison. Détails sur https://docs.gitlab.com/ee/workflow/repository_mirroring.html#pushing-to-a-remote-repository (pensez à supprimer le webhook de notre solution maison).

Commit 7958513e by Guillaume Bernard

Merge branch 'master' of https://framagit.org/guilieb/shellConfig

parents 1a119f2a 6e498d46
......@@ -26,11 +26,11 @@ declare -r OUT="/dev/stdout"
## @var LIBSHELL_INSTALLATION_DIR
## @brief The directory that will server libshell files
declare -r LIBSHELL_INSTALLATION_DIR="${HOME}/.local/bin/libShell"
declare -r LIBSHELL_INSTALLATION_DIR="${HOME}/.local/lib/libShell"
## @var SHELLCONFIG_INSTALLATION_DIR
## @brief The directory that will serve shellConfig files
declare -r SHELLCONFIG_INSTALLATION_DIR="${HOME}/.local/share/shellConfig"
declare -r SHELLCONFIG_INSTALLATION_DIR="${HOME}/.local/lib/shellConfig"
## @var LIBSHELL_GIT_URL
## @brief libShell remote repository
......
......@@ -25,7 +25,7 @@
## @attention Use content of CURRENT_SRV variable
fromServer () {
local index=$(getArrayOffset)
syncServer "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+4]})" "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+5]})"
syncServer "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+1]})" "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+2]})"
}
## @fn toServer
......@@ -33,7 +33,7 @@ fromServer () {
## @attention Use content of CURRENT_SRV variable
toServer () {
local index=$(getArrayOffset)
syncServer "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+6]})" "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+7]})"
syncServer "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+3]})" "$(cut -d'=' -f2 <<< ${CURRENT_SRV[${index}+4]})"
}
## @fn syncServer
......@@ -45,14 +45,7 @@ syncServer () {
local src="${1}"
local dest="${2}"
local index=$(getArrayOffset)
if test "${src}" && "${dest}"; then
port=$(cut -d'=' -f2 <<< "${CURRENT_SRV[${index}+1]}")
user=$(cut -d'=' -f2 <<< "${CURRENT_SRV[${index}+2]}")
host=$(cut -d'=' -f2 <<< "${CURRENT_SRV[${index}+3]}")
rsync -avz -e "ssh -p ${port}" "${user}"@"${host}":"${src}" "${dest}"
else
Log ${ERROR} "One parameter is missing. src : ${src}; dest : ${dest}"
fi
host=$(cut -d'=' -f2 <<< "${CURRENT_SRV[${index}]}")
rsync -avh ${host}:${src} ${dest}
}
......@@ -17,17 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
index=$(getArrayOffset)
server_len=${#SERVERS[@]}
for (( index; index < server_len; index+=8 ))
do
cmd=$(cut -d'=' -f2 <<< "${SERVERS[$index]}")
port=$(cut -d'=' -f2 <<< "${SERVERS[$index+1]}")
user=$(cut -d'=' -f2 <<< "${SERVERS[$index+2]}")
host=$(cut -d'=' -f2 <<< "${SERVERS[$index+3]}")
alias ${cmd}="ssh ${user}@${host} -p ${port}"
done
## @fn sshChangePassword
## @brief Change SSH key password
## @param private key files
......@@ -36,5 +25,3 @@ sshChangePassword()
local input="${1}"
ssh-keygen -f "${input}" -p
}
unset index server_len
......@@ -44,10 +44,6 @@ declare -a CURRENT_SRV=()
## @var The first server
declare -a SRV_1=()
SRV_1+=(NAME="srv")
SRV_1+=(SSH_PORT=22)
SRV_1+=(USERNAME="user")
SRV_1+=(DOMAIN="domain.tld")
SRV_1+=(REMOTE_SRC_DIR="/var/archives")
SRV_1+=(LOCAL_DEST_DIR="/home/${USER}/")
SRV_1+=(LOCAL_SRC_DIR="/home/${USER}/server")
......
......@@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
declare LIBSHELL_DIR="${HOME}/.local/bin/libShell"
declare LIBSHELL_DIR="${HOME}/.local/lib/libShell"
declare SHELLCONFIG_CONF="${HOME}/.shellConfig.conf"
declare SHELLCONFIG_CONF_DIR="${HOME}/.shellConfig"
declare SHELLCONFIG_EXTERNAL_DIR="${HOME}/.shellConfig.external"
......@@ -27,7 +27,6 @@ if [[ -e "${LIBSHELL_DIR}/libShell.sh" ]]; then
source "${LIBSHELL_DIR}/libShell.sh"
else
echo "\e[31mERR : libShell must be installed under $(dirname ${LIBSHELL_DIR}) directory !\e[39m"
exit 1
fi
# The config files
......
......@@ -22,7 +22,7 @@ if [[ -d "${HOME}/.oh-my-zsh" ]]; then
ZSH_THEME="agnoster"
CASE_SENSITIVE="false"
HYPHEN_INSENSITIVE="true"
plugins=(git git-extras gpg-agent command-not-found)
plugins=(git git-extras command-not-found)
declare -x ZSH=${HOME}/.oh-my-zsh
source "${ZSH}"/oh-my-zsh.sh
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment