Files
installer-tool/entrypoint.sh
2023-07-10 13:58:27 +00:00

62 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
toUpperCase() {
echo "$*" | tr '[:lower:]' '[:upper:]';
}
GIT_REPO=$GIT_REPO
if [ "$GIT_REPO" == "" ]; then
GIT_REPO=git.format.hu
fi
ORGANIZATION=$ORGANIZATION
if [ "$ORGANIZATION" == "" ]; then
ORGANIZATION=format
fi
SMARTHOST_PROXY=$(toUpperCase $SMARTHOST_PROXY)
LOCAL_PROXY=$(toUpperCase $LOCAL_PROXY)
VPN_PROXY=$(toUpperCase $VPN_PROXY)
CRON=$(toUpperCase $CRON)
HOST=$HOST
PORT=$PORT
cd /root
if [ "$PORT" == "" ]; then
PORT=20202
fi
if [ "$HOST" == "" ]; then
HOST=git.format.hu
fi
sed -i "s/GIT_REPO/$GIT_REPO/g" /root/.ssh/config;
sed -i "s/HOST/$HOST/g" /root/.ssh/config;
sed -i "s/PORT/$PORT/g" /root/.ssh/config;
# Check git repository permissions"
if [ "$ADDITIONALS" == "true" ]; then
echo "Additional install has started"
sh /additional_install.sh
echo "Additional install has finished"
elif [ -n "$WSL_DISTRO_NAME" ]; then
echo "WSL2 systemd script has started"
sh /wsl2-systemd-script.sh
#systemctl
echo "WSL2 systemd script has finished"
else
if [[ "$SMARTHOST_PROXY" == "YES" || "$SMARTHOST_PROXY" == "TRUE" ]]; then
PROXY_TYPE=smarthost-proxy" "$PROXY_TYPE;
fi
if [ "$PROXY_TYPE" == "" ] ; then
echo "No proxy type deployment defined, exiting."
exit;
fi
sh /deploy.sh
echo "Successfully deployed $PROXY_TYPE"
fi