|
@@ -28,49 +28,6 @@
|
28
|
28
|
# You should have received a copy of the GNU Affero General Public License
|
29
|
29
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
30
|
30
|
|
31
|
|
-NO_OF_ARGS=$#
|
32
|
|
-
|
33
|
|
-PROJECT_NAME='freedombone'
|
34
|
|
-
|
35
|
|
-export TEXTDOMAIN=$PROJECT_NAME-utils-git
|
36
|
|
-export TEXTDOMAINDIR="/usr/share/locale"
|
37
|
|
-
|
38
|
|
-# An optional configuration file which overrides some of these variables
|
39
|
|
-CONFIGURATION_FILE="${PROJECT_NAME}.cfg"
|
40
|
|
-
|
41
|
|
-if [ -f ~/${PROJECT_NAME}.cfg ]; then
|
42
|
|
- CONFIGURATION_FILE=~/${PROJECT_NAME}.cfg
|
43
|
|
-fi
|
44
|
|
-
|
45
|
|
-# friends repo mirrors
|
46
|
|
-FRIENDS_MIRRORS_SERVER=
|
47
|
|
-FRIENDS_MIRRORS_PASSWORD=
|
48
|
|
-FRIENDS_MIRRORS_SSH_PORT=
|
49
|
|
-
|
50
|
|
-function get_friends_servers {
|
51
|
|
- if [ -f $CONFIGURATION_FILE ]; then
|
52
|
|
- if grep -q "FRIENDS_MIRRORS_SERVER" $CONFIGURATION_FILE; then
|
53
|
|
- FRIENDS_MIRRORS_SERVER=$(grep "FRIENDS_MIRRORS_SERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
54
|
|
- fi
|
55
|
|
- if grep -q "FRIENDS_MIRRORS_PASSWORD" $CONFIGURATION_FILE; then
|
56
|
|
- FRIENDS_MIRRORS_PASSWORD=$(grep "FRIENDS_MIRRORS_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
57
|
|
- fi
|
58
|
|
- if grep -q "FRIENDS_MIRRORS_SSH_PORT" $CONFIGURATION_FILE; then
|
59
|
|
- FRIENDS_MIRRORS_SSH_PORT=$(grep "FRIENDS_MIRRORS_SSH_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
60
|
|
- fi
|
61
|
|
- fi
|
62
|
|
-
|
63
|
|
- if [ ! $FRIENDS_MIRRORS_SERVER ]; then
|
64
|
|
- echo "1"
|
65
|
|
- return
|
66
|
|
- fi
|
67
|
|
- if [ ${#FRIENDS_MIRRORS_SERVER} -lt 2 ]; then
|
68
|
|
- echo "1"
|
69
|
|
- return
|
70
|
|
- fi
|
71
|
|
- echo "0"
|
72
|
|
-}
|
73
|
|
-
|
74
|
31
|
function git_clone {
|
75
|
32
|
repo_url="$1"
|
76
|
33
|
destination_dir="$2"
|