Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 48 lines (42 sloc) 1.455 kb
#!/usr/bin/env bash
if [[ "$trace_flag" -eq 1 ]] ; then set -x ; fi
result=0 ; action="$1" ; shift
# TODO: set releases_url
# TODO: set service_url
# TODO: must be root.
# TODO: Allow ',' separated service list.
if [[ "install" = "$action" ]] || [[ "upgrade" = "$action" ]] ; then
mkdir -p "$src_path"
if [[ ! -z "$head_flag" ]] ; then
if [[ ! -d "$src_path/$service/.git" ]] ; then
"$scripts_path"/log "info" "Updating $service repository."
cd "$src_path/$service"/.git
# TODO: Branch update logic.
git pull origin "${branch:-master}"
else
"$scripts_path"/log "info" "Cloning $service repository from $service_repo_url."
cd "$src_path/$service/"
# TODO: git/hg/svn detection, git for now
git clone "$service_repo_url"
fi
else
rm -rf "$src_path/latest"
mkdir -p "$src_path/latest"
curl -O "$releases_url" | tar xf - -C "$src_path/latest"
# TODO: error check and exit on error.
cd "$src_path/latest"/bdsm-*
./install
fi
elif [[ "uninstall" = "$action" ]] ; then
for service in $* ; do
if [[ -d "$services_path/$service/" ]] ; then
rm -rf "$services_path/$service/"
"$scripts_path"/log "info" "$service removed."
else
"$scripts_path"/log "info" "$service is already non-existant."
fi
done
else
"$scripts_path"/log "error" "One action {install,uninstall,upgrade} must be specified with 'service'." ; result=1
fi
exit $result
Jump to Line
Something went wrong with that request. Please try again.