about summary refs log tree commit diff stats
path: root/tools/conf/srv/gitolite/hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/conf/srv/gitolite/hook.sh')
-rw-r--r--tools/conf/srv/gitolite/hook.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/conf/srv/gitolite/hook.sh b/tools/conf/srv/gitolite/hook.sh
index 1f977ca..be6a696 100644
--- a/tools/conf/srv/gitolite/hook.sh
+++ b/tools/conf/srv/gitolite/hook.sh
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/bin/sh
 
 # final packages dir
 packages_dir="/srv/gitolite/deploy/packages"
 # hook work directory
 hook_dir="/srv/gitolite/deploy/hook_dir"
 
-function is_initial(){
+is_initial(){
     local prj_name=$1
     if [ ! -d ${hook_dir}/${prj_name} ]; then
         echo "true"
@@ -14,18 +14,18 @@ function is_initial(){
     fi
 }
 
-function get_remote_rev(){
+get_remote_rev(){
     echo $(wget --no-check-certificate -qO- $1)
 }
 
-function valid_url(){
-    if [[ `wget -S --spider $1 --no-check-certificate 2>&1 | grep 'HTTP/1.1 200 OK'` ]];
+valid_url(){
+    if [[ `wget -S --spider $1 --no-check-certificate 2>&1 | grep -c 'HTTP/1.1 200 OK'` -eq 1 ]];
     then
         echo "true";
     fi
 }
 
-function create_package(){
+create_package(){
     # project name
     local prj_name=$1
     # git repository directory
@@ -87,7 +87,7 @@ function create_package(){
 
     fi
 
-    tar -zcpf ${pkg_tar} --directory=${pkg_dir} .
+    tar -zcpf ${pkg_tar} -C ${pkg_dir} .
 
     echo "Deploy: package ${pkg_tar} ready !"
     rm -r ${pkg_dir}