Works under Ubuntu and Mac OS/X

This commit is contained in:
Mike Slinn
2014-07-29 07:28:44 -07:00
parent a0fbb90048
commit 6d200aa340
4 changed files with 18 additions and 6 deletions

View File

@@ -1,12 +1,13 @@
# Contrib Notes #
The configuration adapts according to the OS.
Linux directory contains scripts for Ubuntu and RedHat.
The configuration script adapts according to the OS.
The `linux` directory contains scripts for Ubuntu and RedHat.
The Mac scripts have been folded in as well.
Common scripts are in this directory.
This version of scripts has so far only been tested on Ubuntu and Mac. Someone else will have to test on RedHat.
To run, type:
To run:
1. Edit `gitbucket.conf` to suit.
2. Type: `install`
install

View File

@@ -1,3 +1,5 @@
# Configuration section is below. Ignore this part
function isUbuntu {
if [ -f /etc/lsb-release ]; then
grep -i ubuntu /etc/lsb-release | head -n 1 | cut -d \ -f 1 | cut -d = -f 2
@@ -12,6 +14,10 @@ function isMac {
if [[ "$(uname -a | cut -d \ -f 1 )" == "Darwin" ]]; then echo yes; fi
}
#
# Configuration section start
#
# Bind host
GITBUCKET_HOST=0.0.0.0
@@ -40,6 +46,9 @@ GITBUCKET_WAR_FILE=$GITBUCKET_WAR_DIR/gitbucket.war
# GitBucket version to fetch when installing
GITBUCKET_VERSION=2.1
#
# End of configuration section. Ignore this part
#
if [ `isUbuntu` ]; then
GITBUCKET_SERVICE=/etc/init.d/gitbucket
elif [ `isRedHat` ]; then
@@ -50,3 +59,4 @@ else
echo "Don't know how to install onto this OS"
exit -2
fi

View File

@@ -98,7 +98,7 @@ restart() {
start
}
## MacOS proxies for System V service hooks:
StartService() {
start
}
@@ -135,3 +135,4 @@ else
esac
exit $RETVAL
fi

View File

@@ -44,7 +44,7 @@ if [ `isUbuntu` ] || [ `isRedHat` ]; then
# Install gitbucket as a service that starts when system boots
sudo chown root:root $GITBUCKET_SERVICE
sudo chmod 755 $GITBUCKET_SERVICE
sudo update-rc.d $GITBUCKET_SERVICE defaults
sudo update-rc.d "$(basename $GITBUCKET_SERVICE)" defaults
echo "Starting GitBucket service"
sudo $GITBUCKET_SERVICE start
elif [ `isMac` ]; then