-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
119 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#!/bin/bash | ||
|
||
clear | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
YELLOW='\033[1;33m' | ||
BLUE='\033[0;34m' | ||
NC='\033[0m' | ||
|
||
|
||
# Wait for the container to fully initialize | ||
sleep 1 | ||
|
||
# Default the TZ environment variable to UTC. | ||
TZ=${TZ:-UTC} | ||
export TZ | ||
|
||
# Default the IMAGE_PROMPT environment variable to something nice | ||
IMAGE_PROMPT=${IMAGE_PROMPT:-$'\033[1m\033[33mcontainer@pterodactyl~ \033[0m'} | ||
export IMAGE_PROMPT | ||
|
||
# Information output | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}Wine Image from gOOvER${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}Running on Debian $(cat /etc/debian_version)${NC}" | ||
echo -e "${YELLOW}Current timezone: $(cat /etc/timezone)${NC}" | ||
echo -e "${YELLOW}Wine Version:${NC} ${RED} $(wine --version)${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
|
||
# Set environment variable that holds the Internal Docker IP | ||
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') | ||
export INTERNAL_IP | ||
|
||
# Switch to the container's working directory | ||
cd /home/container || exit 1 | ||
|
||
## just in case someone removed the defaults. | ||
if [ "${STEAM_USER}" == "" ]; then | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}Steam user is not set.\n ${NC}" | ||
echo -e "${YELLOW}Using anonymous user.\n ${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
STEAM_USER=anonymous | ||
STEAM_PASS="" | ||
STEAM_AUTH="" | ||
else | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}user set to ${STEAM_USER} ${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
fi | ||
|
||
## if auto_update is not set or to 1 update | ||
if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then | ||
DepotDownloader -dir /home/container -app 1007 | ||
DepotDownloader -dir /home/container $( [[ -z ${STEAM_USER} ]] || printf %s "-username ${STEAM_USER} -password ${STEAM_PASS} -remember-password" ) $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '-os windows' ) -app ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" ) $( [[ "${STEAM_VALIDATE}" == "1" ]] && printf %s '-validate' ) | ||
else | ||
echo -e "${BLUE}---------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}Not updating game server as auto update was set to 0. Starting Server${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------${NC}" | ||
fi | ||
|
||
if [[ $XVFB == 1 ]]; then | ||
Xvfb :0 -screen 0 ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT}x${DISPLAY_DEPTH} & | ||
fi | ||
|
||
# Install necessary to run packages | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${RED}First launch will throw some errors. Ignore them${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
mkdir -p $WINEPREFIX | ||
|
||
# Check if wine-gecko required and install it if so | ||
if [[ $WINETRICKS_RUN =~ gecko ]]; then | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}Installing Wine Gecko${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
WINETRICKS_RUN=${WINETRICKS_RUN/gecko} | ||
|
||
if [ ! -f "$WINEPREFIX/gecko_x86.msi" ]; then | ||
wget -q -O $WINEPREFIX/gecko_x86.msi http://dl.winehq.org/wine/wine-gecko/2.47.4/wine_gecko-2.47.4-x86.msi | ||
fi | ||
|
||
if [ ! -f "$WINEPREFIX/gecko_x86_64.msi" ]; then | ||
wget -q -O $WINEPREFIX/gecko_x86_64.msi http://dl.winehq.org/wine/wine-gecko/2.47.4/wine_gecko-2.47.4-x86_64.msi | ||
fi | ||
|
||
wine msiexec /i $WINEPREFIX/gecko_x86.msi /qn /quiet /norestart /log $WINEPREFIX/gecko_x86_install.log | ||
wine msiexec /i $WINEPREFIX/gecko_x86_64.msi /qn /quiet /norestart /log $WINEPREFIX/gecko_x86_64_install.log | ||
fi | ||
|
||
# Check if wine-mono required and install it if so | ||
if [[ $WINETRICKS_RUN =~ mono ]]; then | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}Installing Wine Mono${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
WINETRICKS_RUN=${WINETRICKS_RUN/mono} | ||
|
||
if [ ! -f "$WINEPREFIX/mono.msi" ]; then | ||
wget -q -O $WINEPREFIX/mono.msi https://dl.winehq.org/wine/wine-mono/9.3.0/wine-mono-9.3.0-x86.msi | ||
fi | ||
|
||
wine msiexec /i $WINEPREFIX/mono.msi /qn /quiet /norestart /log $WINEPREFIX/mono_install.log | ||
fi | ||
|
||
# List and install other packages | ||
for trick in $WINETRICKS_RUN; do | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
echo -e "${YELLOW}Installing: ${NC} ${GREEN} $trick ${NC}" | ||
echo -e "${BLUE}---------------------------------------------------------------------${NC}" | ||
winetricks -q $trick | ||
done | ||
|
||
# Replace Startup Variables | ||
MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') | ||
echo ":/home/container$ ${MODIFIED_STARTUP}" | ||
|
||
# Run the Server | ||
eval ${MODIFIED_STARTUP} |