2024-07-02 22:13:03 -07:00
|
|
|
startup_check() {
|
|
|
|
|
|
|
|
if [[ -z "$(ls /volumes)" ]]; then
|
|
|
|
echo "Nothing in /volumes"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -e "/.env" ]]; then
|
|
|
|
echo Missing .env file
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
source /.env
|
|
|
|
if [[ -z "$NAME" ]]; then
|
|
|
|
echo Missing NAME in .env
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [[ -z "$HOST" ]]; then
|
|
|
|
echo Missing HOST in .env
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-07-02 23:47:15 -07:00
|
|
|
if [[ ! -e "~/.ssh/known_hosts" ]]; then
|
2024-07-02 23:44:27 -07:00
|
|
|
echo "Running ssh keyscan"
|
|
|
|
mkdir -p ~/.ssh
|
2024-07-02 23:47:15 -07:00
|
|
|
ssh-keyscan $HOST > ~/.ssh/known_hosts
|
2024-07-02 23:44:27 -07:00
|
|
|
fi
|
2024-07-02 22:13:03 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -e "/id" ]]; then
|
|
|
|
echo Missing ssh identity file
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo Startup check passed
|
|
|
|
}
|
|
|
|
|
|
|
|
startup_check
|
|
|
|
/usr/sbin/cron &
|
|
|
|
sleep infinity
|