26 lines
793 B
Bash
Executable File
26 lines
793 B
Bash
Executable File
#! /bin/sh
|
|
mkdir -p /app/data
|
|
if [ -f "/app/file.fs" ]; then
|
|
mount /app/file.fs /app/data
|
|
fi
|
|
mkdir -p /app/data/home
|
|
mkdir -p /app/data/database
|
|
mkdir -p /app/data/tmp
|
|
ln -sf /app/data/tmp /opt/www/tmp
|
|
if [ ! -z "$ANTOS_USER" ]; then
|
|
[ ! -e "/home/$ANTOS_USER" ] && ln -sf /app/data/home "/home/$ANTOS_USER"
|
|
adduser --home "/home/$ANTOS_USER" --disabled-password --gecos "" "$ANTOS_USER"
|
|
echo "$ANTOS_USER:$ANTOS_PASSWORD" | /bin/chpasswd
|
|
fi
|
|
|
|
unset ANTOS_USER
|
|
unset ANTOS_PASSWORD
|
|
|
|
# start antd-tunnel service
|
|
[ ! -f "/app/antd-config.ini" ] && cp /opt/www/antd-config.ini /app/antd-config.ini
|
|
[ ! -f "/app/runner.ini" ] && cp /opt/www/runner.ini /app/runner.ini
|
|
|
|
/usr/bin/antd /app/antd-config.ini &
|
|
sleep 2
|
|
[ -f /app/runner.ini ] && /opt/www/bin/runner /app/runner.ini &
|
|
wait |