Astroport.ONE/docker/astroport/astroport.sh

40 lines
703 B
Bash
Raw Permalink 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
2023-11-23 12:31:25 +01:00
ASTROPORT_REPO=https://github.com/papiche/Astroport.ONE.git
2022-11-22 23:49:46 +01:00
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-12-10 18:14:30 +01:00
sudo chown zen:users /home/zen /home/zen/.zen /home/zen/.zen/game /home/zen/.zen/game/players
2023-11-23 12:31:25 +01:00
mkdir -p /home/zen/Astroport
2022-11-22 23:49:46 +01:00
[ -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
2023-09-07 20:37:03 +02:00
exec "$ASTROPORT_DIR/launch.sh"
2022-11-22 23:49:46 +01:00
;;
install)
exec /install.sh
;;
*)
exec "$@"
;;
esac