Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #command to manually start if you want to close this script (do it in screen)
- #xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine RustDedicated.exe -batchmode +rcon.ip 0.0.0.0 +rcon.port "48000" +rcon.password killer +server.hostname "-LINUX RUST-US-Pro Admins-NO WIPE-NEWBS WELCOM-" +server.port "28015" +server.identity "nfo_rust_server1" +server.maxplayers "2000"
- #####################################################################################
- # Linux script for Rust server installing. #
- # Can also be used to update Rust server and steamcmd. #
- # Starts a rust server at the end. #
- # #
- # If you use a sudoers file please execute this command first to get root access: #
- # sudo -s #
- # Modded by GregTampa #
- # Original by Unknown_Energy #
- #####################################################################################
- #######################################
- # define some variables first: #
- # please change it to your needs! <-- #
- #######################################
- #directory where everything will be saved
- data_directory="/home/robert"
- #steamname and steamid are need for setting an owner of rust server
- owner_name="GregTampa"
- owner_steamid="76561197963365871"
- owner_name2="osteth"
- owner_steamid2="76561198035643024"
- #some setting for rust server
- server_hostname="Jigabot"
- server_port=28015
- server_identity="nfo_rust_server1"
- server_maxplayers=1000
- rcon.port=48010
- rcon.password="password123"
- #note I haven't got oxide to work within wine yet
- #login data for forum of mod oxide:
- oxide_login="GregTampa"
- oxide_password="mysuperpassword"
- #set version of oxide to download
- oxide_version=5369
- #set version of some plugins fpr oxide
- oxide_give_version=3813
- oxide_teleportation_version=3711
- oxide_kits_version=3811
- oxide_removertool_version=3837
- oxide_godmode_version=3192
- oxide_time_version=3819
- oxide_playerlist_version=3819
- oxide_helptext_version=3367
- oxide_gatherrate_version=3721
- oxide_craftingrate_version=3820
- oxide_airdropsettings_version=3846
- oxide_autobroadcast_version=2797
- oxide_airdrop_controller=5066
- #####################################################################
- # first install dialog and show some dialogs with questions: #
- #####################################################################
- apt-get install dialog
- dialog --backtitle Question --title "Rust-Server" --yesno "Do you want to install/update wine and some libs?" 15 60
- update_wine=${?}
- dialog --backtitle Question --title "Rust-Server" --yesno "Do you want to install/update SteamCMD?" 15 60
- update_steamcmd=${?}
- dialog --backtitle Question --title "Rust-Server" --yesno "Do you want to install/update Rust-Server?" 15 60
- update_rust=${?}
- dialog --backtitle Question --title "Rust-Server" --yesno "Do you want to install/update Oxide mod and its plugins? SAY NO FOR NOW" 15 60
- update_oxide=${?}
- dialog --backtitle Question --title "Rust-Server" --yesno "Do you want to set serverowner?" 15 60
- set_owner=${?}
- dialog --backtitle Question --title "Rust-Server" --yesno "Do you want start the server?" 15 60
- start_server=${?}
- #####################################################################
- # installs wine, other needed libs and creats "steam" user: #
- #####################################################################
- if [ "$update_wine" -eq "0" ]
- then
- #adds the wine repo
- add-apt-repository -y ppa:ubuntu-wine/ppa
- #makes a update
- apt-get -y update
- #installs the lib needed for steamcmd + xvfb for window mode of rust + wine
- apt-get install -y lib32gcc1 libc6-amd64 xvfb wine1.7
- #creates a new Linux user called steam
- useradd -m steam
- fi
- #####################################################################
- # updates steamcmd: #
- #####################################################################
- if [ "$update_steamcmd" -eq "0" ]
- then
- #first makes directory called steamcmd/ and then downloads and unpacks steamcmd.
- mkdir $data_directory/steamcmd
- cd $data_directory/steamcmd
- wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
- tar -xvzf steamcmd_linux.tar.gz
- rm steamcmd_linux.tar.gz
- fi
- #####################################################################
- # updates rust server: #
- #####################################################################
- if [ "$update_rust" -eq "0" ]
- then
- cd $data_directory/steamcmd
- #after that steam.sh is executed with some commands: Download windows rust server, login anonymous ...
- ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login anonymous +force_install_dir $data_directory/rust +app_update 258550 -beta experimental validate +quit
- fi
- #####################################################################
- # updates mod essentials: #
- #####################################################################
- #wget http://rustessentials.com/versions/1.0.0/RustEssentialsRedux.zip
- #unzip -o RustEssentialsRedux.zip -d ~/Steam/steamapps/common/rust_dedicated/
- #rm RustEssentialsRedux.zip
- #####################################################################
- # updates mod oxide and plugins: #
- #####################################################################
- if [ "$update_oxide" -eq "0" ]
- then
- #enters server directory
- cd $data_directory/rust
- #Install mod oxide for rust
- postdata="login="$oxide_login"&password="$oxide_password
- wget --keep-session-cookies --save-cookies=cookies.txt --post-data=$postdata http://oxidemod.org/login/login
- wget --load-cookies cookies.txt -p http://oxidemod.org/downloads/oxide-for-rust-experimental.714/download?version=$oxide_version -O Oxide-Rust.zip
- unzip -o Oxide-Rust.zip
- #Install plugins for oxide
- mkdir $data_directory/rust/server/$server_identity/oxide/plugins/ -p
- #remove cookies for oxide forum site and remove zipped oxide rust
- rm Oxide-Rust.zip
- rm cookies.txt
- fi
- #####################################################################
- # sets serverowner: #
- #####################################################################
- if [ "$set_owner" -eq "0" ]
- then
- #Creates users.cfg and adds a User as owner of the server, so that this user can execute console commands with (F1 Menu).
- mkdir $data_directory/rust/server/$server_identity/cfg/ -p
- touch $data_directory/rust/server/$server_identity/cfg/users.cfg
- echo "ownerid $owner_steamid $owner_name" > $data_directory/rust/server/$server_identity/cfg/users.cfg
- echo "ownerid $owner_steamid2 $owner_name2" > $data_directory/rust/server/$server_identity/cfg/users.cfg
- fi
- #####################################################################
- # starts server: #
- #####################################################################
- if [ "$start_server" -eq "0" ]
- then
- chmod -R 777 /home/steam
- wineboot --update
- #first makes sure user "steam" has all rights
- chown steam $data_directory/ -R
- #runs rust.exe in wine
- su - steam -c "cd $data_directory/rust;xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' WINEARCH=win64 WINEPREFIX=~/.wine64 wine RustDedicated.exe -batchmode +rcon.ip 0.0.0.0 +rcon.port $rcon.port +rcon.password $rcon.password +server.hostname $server_hostname +server.port $server_port +server.identity $server_identity +server.maxplayers $server_maxplayers"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement