-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
install.sh
82 lines (65 loc) · 2.41 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# install.sh - Plutonium Call of Duty: Black Ops II Server Installation Script
# Version: 2.1.0
# Author: Sterbweise
# Last Updated: 21/08/2024
# Description:
# This script automates the installation process for a Plutonium Call of Duty: Black Ops II
# dedicated server. It handles system updates, firewall configuration, Wine installation,
# .NET framework setup, and game binary installation.
# Usage:
# Run this script with sudo permissions:
# sudo ./install.sh
# Note: This script requires an active internet connection and sudo privileges.
# Source configuration and function files
# These files contain necessary variables and functions used throughout the script
DEFAULT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
source "$DEFAULT_DIR/.config/config.sh"
source "$DEFAULT_DIR/.config/functions.sh"
# Check for sudo permissions
# The script requires elevated privileges to perform system-wide changes
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo $0 $*"
exit 1
fi
# Display logo and clear screen
# This function improves user experience by presenting a clean interface
clear_and_show_logo
# Language selection
# Allows users to choose their preferred language for script messages
select_language
clear_and_show_logo
# Ask for installation options
# Prompts the user for specific components they want to install
ask_installations
clear_and_show_logo
# Update the system
# Ensures the system is up-to-date before proceeding with the installation
update_system
# Configure firewall if requested
# Sets up firewall rules to allow server traffic if the user opts for it
if [[ "$firewall" =~ ^[yYoO]$ ]] || [[ -z "$firewall" ]]; then
install_firewall "$ssh_port"
fi
# Enable 32-bit packages
# Required for compatibility with certain components of the server
enable_32bit_packages
# Install Wine
# Necessary for running Windows executables on Linux
install_wine
# Install Dotnet if requested
# Required for certain server functionalities
if [[ "$dotnet" =~ ^[yYoO]$ ]] || [[ -z "$dotnet" ]]; then
install_dotnet
fi
# Install game binaries
# Downloads and sets up the necessary game files for the server
install_game_binaries
# Display installation completion message
# Informs the user that the installation process is complete
finish_installation
# Reset terminal settings and exit
# Ensures the terminal is left in a clean state after script execution
stty -igncr
exit