#!/bin/sh #------------------------------------------------------------------------------ # /var/install/bin/subversion-tools-recover - recover repository # # Creation : 2018-07-11 daniel # Last Update: 2023-07-23 09:11:10 # # Copyright (c) 2024 the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------ #include eislib . /var/install/include/eislib . /etc/config.d/subversion mode="single" # ---------------------------------------------------------------------------- # check if "-all" option is supplied # ---------------------------------------------------------------------------- if [ "$1" = "-all" ] then mode="all" fi #---------------------------------------------------------------------------- # do the main job #---------------------------------------------------------------------------- if [ "${mode}" = "single" ] then # clear window before selection of repository clrhome # select repository mecho -info "Select repository to repair:" # list respositories techo begin 4 12 52 techo row -info No -info Name -info Path idx="1" while [ "${idx}" -le "${SVN_REPOS_N}" ] do eval repodir='${SVN_REPOS_'${idx}'_DIR}' eval reponame='${SVN_REPOS_'${idx}'_NAME}' techo row "${idx}" "${reponame}" "${repodir}" idx=$((${idx} + 1)) done techo end # ask for selection mecho "" sel_repo=$(/var/install/bin/ask "Select (0 = cancel)" "${sel_repo}" "0-${SVN_REPOS_N}") if [ "${sel_repo}" = "0" ] then mecho -info "command canceled" anykey exit 0 fi # perform repair eval repodir='${SVN_REPOS_'${sel_repo}'_DIR}' eval reponame='${SVN_REPOS_'${sel_repo}'_NAME}' mecho -n " * Recovery of repository: " mecho -n --info "$reponame" mecho " ..." # call svnadmin svnadmin recover ${repodir} > /dev/null if [ "$?" = "0" ] then mecho --ok else mecho --fail fi # make repo accessible for WebDAV /var/install/bin/subversion-tools-permissions ${repodir} # completed! mecho "Completed!" anykey else idx="1" while [ "${idx}" -le "${SVN_REPOS_N}" ] do eval repodir='${SVN_REPOS_'${idx}'_DIR}' eval reponame='${SVN_REPOS_'${idx}'_NAME}' mecho -n " * Recovery of repository: " mecho -n --info "${reponame}" mecho " ..." # call svnadmin svnadmin recover ${repodir} > /dev/null if [ "$?" = "0" ] then mecho --ok else mecho --fail fi # make repo accessible for WebDAV /var/install/bin/subversion-tools-permissions ${repodir} idx=$((${idx} + 1)) done fi