16 lines
526 B
Bash
16 lines
526 B
Bash
|
#!/bin/sh
|
||
|
DIR=$(dirname $(readlink -f "$0"))
|
||
|
cd $DIR
|
||
|
[ ! -e $DIR/probotic ] && echo "You should run './build.sh' before this script." \
|
||
|
&& return
|
||
|
# run bootstrapper
|
||
|
[ ! -e $DIR/bootstrap/ ] && $DIR/bootstrap/bootstrap.sh
|
||
|
# generate directories and prepare for install
|
||
|
TARGET=${TARGET-/opt/probotic}
|
||
|
mkdir -p $TARGET
|
||
|
useradd -r -s /sbin/nologin probotic -d $TARGET
|
||
|
cp $DIR/bootstrap/probotic_data.sqlite $TARGET
|
||
|
chown probotic:probotic $TARGET -R
|
||
|
# install files
|
||
|
install -g=probotic -o=probotic -m 744 probotic -sv $TARGET
|