Browse Source

Initial commit

tags/v1.0.0
Bernhard Fröhlich 1 year ago
commit
9c00da8e3b
Signed by: Bernhard Froehlich <decke@bluelife.at> GPG Key ID: 4DD88C3F9F3B8333
9 changed files with 683 additions and 0 deletions
  1. 56
    0
      LICENSE
  2. 34
    0
      Makefile
  3. 82
    0
      README.md
  4. 42
    0
      lib/base
  5. 87
    0
      lib/cmd
  6. 104
    0
      lib/config
  7. 205
    0
      lib/util
  8. 28
    0
      rc.d/ssbt
  9. 45
    0
      ssbt

+ 56
- 0
LICENSE View File

@@ -0,0 +1,56 @@
Copyright 2018 Bernhard Froehlich <decke@bluelife.at>
All rights reserved

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


========================================================================

Parts of the code were copied from vm-bhyve under the BSD License:
https://github.com/churchers/vm-bhyve


Copyright (c) 2015-2016, churchers
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 34
- 0
Makefile View File

@@ -0,0 +1,34 @@
#
# ssbt Makefile
#

PREFIX?=/usr/local
BINDIR=$(DESTDIR)$(PREFIX)/sbin
LIBDIR=$(DESTDIR)$(PREFIX)/lib/ssbt
MANDIR=$(DESTDIR)$(PREFIX)/man/man8
RCDIR=$(DESTDIR)$(PREFIX)/etc/rc.d

CP=/bin/cp
INSTALL=/usr/bin/install
MKDIR=/bin/mkdir

PROG=ssbt
MAN=$(PROG).8

install:
$(MKDIR) -p $(BINDIR)
$(INSTALL) -m 544 $(PROG) $(BINDIR)/

$(MKDIR) -p $(LIBDIR)
$(INSTALL) lib/* $(LIBDIR)/

$(MKDIR) -p $(RCDIR)
$(INSTALL) -m 555 rc.d/* $(RCDIR)/

$(MKDIR) -p $(MANDIR)
gzip -fk $(MAN)
$(INSTALL) $(MAN).gz $(MANDIR)/
rm -f -- $(MAN).gz

.MAIN: clean
clean: ;

+ 82
- 0
README.md View File

@@ -0,0 +1,82 @@
## ssbt (Simple Stupid Backup Tool)

You create a backup on your machine and ssbt will periodically
collect and archive it.

* Simple (no database, just filesystem and a config)
* Secure (using chrooted sftp)
* Archive old backups
* First class FreeBSD support


## But why yet another backup solution?

Backups should be simple and reliable to make sure they are as painless as
possible. I know there are a lot of tools out there with fancy webinterfaces,
agents for whatever service you might run, multiuser, cross platform and much
more. You will not find any of those features here.

What you will find is a simple shellscript which will periodically log into
your machines with sftp(1) and pull tar archives from there which get archived.

You can continue to create your backups with tar(1) and be sure those are
archived on your backup master.


## Quick-Start

### Client

A account is needed which will be used by the master to login and fetch the
backups. It is recommended to create a separate account with a separate
SSH certificate. This account can also be limited to only allow sftp to
reduce the risk.

This example assumes that you backup to `/backup/data` but this can be any
directory.

# adduser -d "" -D -s nologin -w no
Username: backup
Full name:
Uid (Leave empty for default):
Login group [backup]:
Login group is backup. Invite backup into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [nologin]:
Home directory [/backup]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [no]:
Lock out the account after creation? [no]:
Username : backup
Password : <disabled>
Full Name :
Uid : 1001
Class :
Groups : backup
Home : /backup
Home Mode :
Shell : /usr/sbin/nologin
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (backup) to the user database.
Add another user? (yes/no): no
Goodbye!

# mkdir -m 0755 /backup
# install -d -m 0700 -g backup -o backup /backup/.ssh
# install -d -m 0700 -g backup -o backup /backup/data

# install -m 0400 -g backup -o backup /dev/null /backup/.ssh/authorized_keys
# echo "...your-public-key-here..." > /backup/.ssh/autorized_keys

# printf "\nMatch User backup\n" >> /etc/ssh/sshd_config
# printf "\tChrootDirectory %%h\n" >> /etc/ssh/sshd_config
# printf "\tForceCommand internal-sftp\n" >> /etc/ssh/sshd_config
# printf "\tX11Forwarding no" >> /etc/ssh/sshd_config

# /etc/rc.d/sshd reload


### Backup master



+ 42
- 0
lib/base View File

@@ -0,0 +1,42 @@
#!/bin/sh
#
# Copyright 2018 Bernhard Froehlich <decke@bluelife.at>
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

VERSION=0.1

. /etc/rc.subr
load_rc_config "ssbt"

# create directories as needed
[ ! -d "${ssbt_dir}" ] && util::err "\$ssbt_dir has not been configured or is not a valid directory"
[ ! -d "${ssbt_dir}/.config" ] && mkdir "${ssbt_dir}/.config"

# load core configuration
config::core::load

# run the requested command
cmd::parse "$@"

+ 87
- 0
lib/cmd View File

@@ -0,0 +1,87 @@
#!/bin/sh
#-------------------------------------------------------------------------+
# Copyright (C) 2016 Matt Churchyard (churchers@gmail.com)
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

CMD_VALID_LIST="cron,pull,status,usage,version"

# cmd: ssbt ...
#
# process the command line to see which function is requested
#
# @param string _cmd the command right after 'ssbt '
#
cmd::parse(){
local _cmd

# try to find a matching command
cmd::find "_cmd" "$1" "${CMD_VALID_LIST}" || util::usage
shift

case "${_cmd}" in
cron) core::cron "$@" ;;
pull) core::pull "$@" ;;
status) core::status "$@" ;;
usage) util::usage ;;
version) util::version && exit ;;
*) util::err "unknown command '${_user_cmd}'. please run 'ssbt usage' or view the manpage for help" ;;
esac
}

# try to match part of a command name against a list of valid commands
# if we find more than one match we return an error
# if we only get one match, return the full command name
#
# @param string _var variable to put full command name into
# @param string _user_cmd the value provided by the user
# @param string _valid comma-separated list of valid choices
# @return success if we find one match
#
cmd::find(){
local _var="$1"
local _user_cmd="$2"
local _valid="$3"
local _opt _choice _found=""
local IFS=","

[ -n "${_user_cmd}" ] || util::err "no command specified"

for _opt in ${_valid}; do
# exact match?
if [ "${_user_cmd}" = "${_opt}" ]; then
setvar "${_var}" "${_opt}"
return 0
fi

if echo "${_opt}" | grep -iqs "^${_user_cmd}"; then
[ -n "${_found}" ] && util::err "ambiguous command '${_user_cmd}'"

_found=1
_choice="${_opt}"
fi
done

[ -z "${_found}" ] && return 1
setvar "${_var}" "${_choice}"
}

+ 104
- 0
lib/config View File

@@ -0,0 +1,104 @@
#!/bin/sh
#-------------------------------------------------------------------------+
# Copyright (C) 2016 Matt Churchyard (churchers@gmail.com)
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# load a configuration file
# this reads the specfied file into the global SSBT_CONFIG variable.
# we have very basic parsing that uses # for comments and requires
# all variables to be at the beginning of the line in lowercase.
# Note also that a # within double quotes will still be treated
# as the start of a comment.
#
# @param string _file full path of the file to read
# @modifies SSBT_CONFIG
#
config::load(){
local _file="$1"

# read config file
# we kick out any lines that don't start with a letter,
# scrap anything after a # character, and remove double-quotes
SSBT_CONFIG=$(grep '^[a-z]' "${_file}" 2>/dev/null | awk -F# '{print $1}' | sed -e 's@ *$@@' | tr -d '"')
}

# get a configuration value from the current config file
#
# @param string _var the variable to put value into
# @param string _key the name of the config key to retrieve
# @param optional string _def default value to return if setting not found
# @return true if setting found
#
config::get(){
local _c_var="$1"
local _c_key="$2"
local _c_def="$3"
local _c_line
local IFS=$'\n'

for _c_line in ${SSBT_CONFIG}; do
if [ "${_c_key}" = "${_c_line%%=*}" ]; then
setvar "${_c_var}" "${_c_line#*=}"
return 0
fi
done

# not found
setvar "${_c_var}" "${_c_def}"
return 1
}

# load core configuration file
#
# @modifies SSBT_CORE_CONFIG
#
config::core::load(){
SSBT_CORE_CONFIG=$(grep '^[a-z]' "${ssbt_dir}/.config/system.conf" 2>/dev/null | awk -F# '{print $1}' | sed -e 's@ *$@@' | tr -d '"')
}

# get a value from core config
#
# @param string _c_var variable name to put value into
# @param string _c_key config key to look for
# @param string _c_def default value if not value
# @return 0 if found
#
config::core::get(){
local _c_var="$1"
local _c_key="$2"
local _c_def="$3"
local _c_line
local IFS=$'\n'

for _c_line in ${SSBT_CORE_CONFIG}; do
if [ "${_c_key}" = "${_c_line%%=*}" ]; then
setvar "${_c_var}" "${_c_line#*=}"
return 0
fi
done

# not found
setvar "${_c_var}" "${_c_def}"
return 1
}

+ 205
- 0
lib/util View File

@@ -0,0 +1,205 @@
#!/bin/sh
#-------------------------------------------------------------------------+
# Copyright (C) 2016 Matt Churchyard (churchers@gmail.com)
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# show version
#
util::version(){
echo "ssbt: simple stupid backup tool v${VERSION}"
}

# show version & usage information
# we exit after running this
#
util::usage(){
util::version
cat << EOT
Usage: ssbt ...
cron
pull <host>
status <host>
usage
version
EOT
exit 1
}

# err
# display an error message and exit immediately
#
# @param string - the message to display
#
util::err(){
echo "${0}: ERROR: $1" >&2
exit 1
}

# err_inline
# display an error inline with informational output
#
# @param string - message to display
#
util::err_inline(){
echo " ! $1"
exit 1
}

# warn
# display warning, but do not exit
#
# @param string - the message to display
#
util::warn(){
echo "${0}: WARNING: $1" >&2
}

# log_rotate
# simple rotation of log files
# if we hit 1MB, which should cover a fair amount of history,
# we move existing log and and create a new one.
# one keep 1 previous file, as that should be enough
#
# @param string _type whether to rotate host or main log
#
util::log_rotate(){
local _type="$1"
local _lf="ssbt.log"
local _file _size _host

case "${_type}" in
host)
_host="$2"
_file="${ssbt_dir}/${_host}/${_lf}"
;;
system)
_file="${ssbt_dir}/${_lf}"
;;
esac

if [ -e "${_file}" ]; then
_size=$(stat -f %z "${_file}")

if [ -n "${_size}" -a "${_size}" -ge 1048576 ]; then
unlink "${_file}.0.gz" >/dev/null 2>&1
mv "${_file}" "${_file}.0"
gzip "${_file}.0"
fi
fi
}

# log to file
# writes the date and a message to the specified log
# the global log is in $ssbt_dir/ssbt.log
# host logs are $ssbt_dir/{host}/ssbt.log
#
# @param string _type=host|system log to global ssbt log or host
# @param optional string _host if _type=host, the hostname, otherwise do not provide at all
# @param string _message the message to log
#
util::log(){
local _type="$1"
local _lf="ssbt.log"
local _host _message _file _date

case "${_type}" in
host)
_host="$2"
_file="${ssbt_dir}/${_host}/${_lf}"
shift 2
;;
system)
_file="${ssbt_dir}/${_lf}"
shift 1
;;
esac

while [ -n "$1" ]; do
echo "$(date +'%b %d %T'): $1" >> "${_file}"
shift
done
}

# write content to a file, and log what we
# did to the host log file
# it's useful to be able to see what files ssbt is creating
# and the contents so we write that to the log.
# The file is created in $ssbt_dir/{host}
#
# @param string _type=write|appnd create file or append to it
# @param string _host the hostname
# @param string _file the file name to write to
# @param string _message the data to write
#
util::log_and_write(){
local _type="$1"
local _host="$2"
local _file="${ssbt_dir}/${_host}/$3"
local _message="$4"

if [ "${_type}" = "write" ]; then
util::log "host" "${_host}" "create file ${_file}"
echo "${_message}" > "${_file}"
else
echo "${_message}" >> "${_file}"
fi

util::log "host" "${_host}" " -> ${_message}"
}

# confirm yes or no
#
# @param string _msh message to display
# @return int success if confirmed
#
util::confirm(){
local _msg="$1"
local _resp

while read -p "${_msg} (y/n)? " _resp; do
case "${_resp}" in
y*) return 0 ;;
n*) return 1 ;;
esac
done
}

# our own checkyesno copy
# doesn't warn for unsupported values
# also returns as 'yes' unless value is specifically no/off/false/0
#
# @param _value the value to test
# @return int 1 if set to "off/false/no/0", 0 otherwise
#
util::checkyesno(){
local _value="$1"

[ -z "${_value}" ] && return 1

case "$_value" in
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
return 1 ;;
*) return 0 ;;
esac
}

+ 28
- 0
rc.d/ssbt View File

@@ -0,0 +1,28 @@
#!/bin/sh
#
# $FreeBSD$

# PROVIDE: ssbt
# REQUIRE: NETWORKING SERVERS dmesg
# BEFORE:
# KEYWORD: shutdown nojail

. /etc/rc.subr

: ${ssbt_enable="NO"}

name=ssbt
desc="Pull backups automatically on boot"
rcvar=ssbt_enable

load_rc_config $name

command="/usr/local/sbin/${name}"
start_cmd="${name}_start"

ssbt_start()
{
${command} cron >/dev/null &
}

run_rc_command "$1"

+ 45
- 0
ssbt View File

@@ -0,0 +1,45 @@
#!/bin/sh
#
# Copyright 2018 Bernhard Froehlich <decke@bluelife.at>
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# get libs
if [ -e "./lib" ]; then
LIB="./lib"
elif [ -e "/usr/local/lib/ssbt" ]; then
LIB="/usr/local/lib/ssbt"
else
echo "unable to locate ssbt libraries"
exit 1
fi

# load libs

. "${LIB}/cmd"
. "${LIB}/config"
. "${LIB}/util"

. "${LIB}/base"

Loading…
Cancel
Save