Astroport.ONE/docker/astroport/astroport.sh

41 lines
680 B
Bash
Raw Normal View History

2022-11-22 23:49:46 +01:00
#!/usr/bin/env sh
[ -n "${DEBUG}" ] && set -x
set -euo errexit
ASTROPORT_DIR=/home/zen/.zen/Astroport.ONE
ASTROPORT_REPO=https://git.p2p.legal/qo-op/Astroport.ONE.git
cron() {
sudo service cron start
}
log() {
2022-11-23 19:28:20 +01:00
tail -F /var/log/auth.log /var/log/pam-script.log >&2
2022-11-22 23:49:46 +01:00
}
zen() {
2022-11-28 20:22:14 +01:00
mkdir -p /dev/shm/tmp \
&& rm -rf /home/zen/.zen/tmp \
2022-11-22 23:49:46 +01:00
&& ln -s /dev/shm/tmp /home/zen/.zen/tmp
[ -d "$ASTROPORT_DIR" ] && cd "$ASTROPORT_DIR" && git pull -q || git clone -q "$ASTROPORT_REPO" "$ASTROPORT_DIR"
}
case "${1:-${cmd:-start}}" in
start)
cron
log &
zen
exec "$ASTROPORT_DIR/start.sh"
;;
install)
exec /install.sh
;;
*)
exec "$@"
;;
esac