Index: /bootstrapper/bootstrap.sh
===================================================================
--- /bootstrapper/bootstrap.sh	(revision 29)
+++ /bootstrapper/bootstrap.sh	(revision 30)
@@ -1,10 +1,15 @@
 #!/bin/bash
-
-INSTALLOPTIONALDEPS=0
+# Version 1
+
+if [ `id -u` -ne 0 ]; then
+	echo "This script has to be run as root!"
+	exit 1
+fi
+
+
 ADDCRONJOBS=0
 RUNINSTALL=0
 
-DEPENDENCIES="xvfb mono-runtime rsync libxml2-utils"
-OPTDEPENDENCIES="sendemail sendxmpp"
+DEPENDENCIES="xvfb mono-runtime rsync xmlstarlet"
 
 if [ -n "$(command -v apt-get)" ]; then
@@ -20,5 +25,5 @@
 fi
 
-if [[ $IS64BIT == 1 ]]; then
+if [ $IS64BIT -eq 1 ]; then
 	DEPENDENCIES="$DEPENDENCIES lib32gcc1 wine:i386"
 else
@@ -27,8 +32,8 @@
 
 showHelp() {
-	echo "Usage: ./bootstrap.sh [-h] [-o] [-c] -i"
+	echo "Usage: ./bootstrap.sh [-h] [-c] -i"
 	echo "Parameters:"
 	echo "  -h   Print this help screen and exit"
-	echo "  -o   Install optional dependencies ($OPTDEPENDENCIES)"
+#	echo "  -o   Install optional dependencies ($OPTDEPENDENCIES)"
 	echo "  -c   Add cron jobs for save backups and memory checking"
 	echo "  -i   Required to actually start the installation"
@@ -41,5 +46,5 @@
 	echo "This will install a 7DtD server according to the information"
 	echo "given on:"
-	echo "   http://7daystodie.gamepedia.com/Linux_Server"
+	echo "   https://7dtd.illy.bz/"
 	echo
 	read -p "Press enter to continue"
@@ -48,10 +53,11 @@
 
 nonDebianWarning() {
-	if [[ $ISDEBIAN == 0 ]]; then
+	if [ $ISDEBIAN -eq 0 ]; then
 		echo "NOTE: It seems like this system is not based on Debian."
 		echo "Although installation of the scripts and SteamCMD/7dtd"
 		echo "will work the installed management scripts will probably"
-		echo "*NOT* work out of the box and installation of dependencies"
-		echo "will fail too."
+		echo "fail because of missing dependencies. Make sure you check"
+		echo "the website regarding the prerequisites"
+		echo "(https://7dtd.illy.bz)."
 		echo "Do you want to continue anyway?"
 		select yn in "Yes" "No"; do
@@ -72,5 +78,5 @@
 installAptDeps() {
 	echo -e "Installing dependencies\n"
-	if [[ $IS64BIT == 1 ]]; then
+	if [ $IS64BIT -eq 1 ]; then
 		dpkg --add-architecture i386
 	fi
@@ -95,10 +101,28 @@
 	echo -e "Downloading and installing management scripts\n"
 	wget -nv http://illy.bz/fi/7dtd/management_scripts.tar.gz -O /tmp/management_scripts.tar.gz
-	tar -xzf /tmp/management_scripts.tar.gz --no-same-owner --owner=root --group=root -C /
-	chmod go-rwx /etc/7dtd.conf
-	chmod +x /etc/init.d/7dtd.sh
-	chmod +x /usr/local/bin/7dtd-*
-	if [[ $ISDEBIAN == 1 ]]; then
+	tar --touch -xzf /tmp/management_scripts.tar.gz -C /
+
+	chown root.root /etc/7dtd.conf
+	chmod 0600 /etc/7dtd.conf
+
+	chown sdtd.sdtd /home/sdtd -R
+
+	chown root.root /etc/init.d/7dtd.sh
+	chown root.root /etc/bash_completion.d/7dtd
+	chown root.root /usr/local/bin/7dtd.sh
+	chown root.root /usr/local/lib/7dtd -R
+	chmod 0755 /etc/init.d/7dtd.sh
+	chmod 0755 /etc/bash_completion.d/7dtd
+	chmod 0755 /usr/local/bin/7dtd.sh
+	chmod 0755 /usr/local/lib/7dtd -R
+
+	if [ $ISDEBIAN -eq 1 ]; then
 		update-rc.d 7dtd.sh defaults
+	else
+		echo
+		echo "Compiling start-stop-daemon"
+		cd /usr/local/lib/7dtd/start-stop-daemon
+		make
+		make install
 	fi
 	echo -e "\n=============================================================\n\n"
@@ -117,82 +141,40 @@
 installSteamCmdAndSDTD() {
 	echo -e "Installing SteamCMD and 7DtD\n"
-	7dtd-update.sh
-	cp -p /home/sdtd/7dtd/serverconfig.xml /home/sdtd/
-	echo -e "\n=============================================================\n\n"
-}
-
-setupServerConfig() {
-	echo -e "Setting up basic 7DtD server config\n"
-
-	until [[ $public == "y" || $public == "n" ]]; do
-		read -p "Should the server be public [yn]? " public
-	done
-	if [[ "$public" == "y" ]]; then public=true; else public=false; fi
-	echo
-
-	read -p "Server name: " servername
-	echo
-	read -p "Server password (empty for none): " serverpassword
-	echo
-
-	echo "Select world to play on:"
-	select worldname in "Navezgane" "MP Forest Horde" "MP Forest Skirmish" "MP Wasteland Horde" "MP Wasteland Skirmish" "MP Wasteland War"; do
-		if [[ -n $worldname ]]; then
-			break
-		fi
-	done
-	echo
-
-	echo "Select game mode:"
-	select gamemode in "GameModeSurvival" "GameModeZombieHorde" "GameModeDeathmatch"; do
-		if [[ -n $gamemode ]]; then
-			break
-		fi
-	done
-	echo
-
-	read -p "Game name: " gamename
-	echo
-	read -p "Difficulty (0-4): " difficulty
-	echo
-
-	sed -i "s/name=\"ServerIsPublic\".*value=\"[^\"]*\"/name=\"ServerIsPublic\" value=\"$public\"/" /home/sdtd/serverconfig.xml
-	sed -i "s/name=\"ServerName\".*value=\"[^\"]*\"/name=\"ServerName\" value=\"$servername\"/" /home/sdtd/serverconfig.xml
-	sed -i "s/name=\"ServerPassword\".*value=\"[^\"]*\"/name=\"ServerPassword\" value=\"$serverpassword\"/" /home/sdtd/serverconfig.xml
-	sed -i "s/name=\"GameWorld\".*value=\"[^\"]*\"/name=\"GameWorld\" value=\"$worldname\"/" /home/sdtd/serverconfig.xml
-	sed -i "s/name=\"GameName\".*value=\"[^\"]*\"/name=\"GameName\" value=\"$gamename\"/" /home/sdtd/serverconfig.xml
-	sed -i "s/name=\"GameDifficulty\".*value=\"[^\"]*\"/name=\"GameDifficulty\" value=\"$difficulty\"/" /home/sdtd/serverconfig.xml
-	sed -i "s/name=\"GameMode\".*value=\"[^\"]*\"/name=\"GameMode\" value=\"$gamemode\"/" /home/sdtd/serverconfig.xml
-	sed -i "s/name=\"TelnetPort\".*value=\"[^\"]*\"/name=\"TelnetPort\" value=\"25003\"/" /home/sdtd/serverconfig.xml
-
+	7dtd.sh updateengine
 	echo -e "\n=============================================================\n\n"
 }
 
 addCronJobs() {
-	echo -e "Adding cron jobs\n"
+	echo -e "Enabling backup cron job\n"
 
 	echo -e "By default a backup of the save folder will be created once"
 	echo -e "  per hour. This can be changed in /etc/cron.d/7dtd-backup."
-	echo -e "Memory monitor will be run every five minutes by default."
-	echo -e "  This can be changed in /etc/cron.d/7dtd-check_mem."
-
-	echo "0 *     * * *   root    /usr/local/bin/7dtd-backup.sh" > /etc/cron.d/7dtd-backup
-	echo "*/5 *   * * *   root    /usr/local/bin/7dtd-check_mem.sh" > /etc/cron.d/7dtd-check_mem
-
-	echo -e "\nNOTE: Do not forget to edit /etc/7dtd.conf to match\nyour notification needs!"
+	
+	cat /etc/cron.d/7dtd-backup | tr -d '#' > /tmp/7dtd-backup
+	cp /tmp/7dtd-backup /etc/cron.d
+
 	echo -e "\n=============================================================\n\n"
 }
 
 finish() {
-	echo -e "\n ALL DONE\n"
-	echo -e "You should now be able to start your 7dtd server by running\n"
-	echo -e "      7dtd-start.sh\n"
+	if [ $ISDEBIAN -eq 0 ]; then
+		echo
+		echo "You are not running a Debian based distribution."
+		echo "The following things should manually be checked:"
+		echo " - Existence of prerequsities"
+		echo " - Running the init-script on boot"
+	else
+		echo -e "\n ALL DONE"
+	fi
+
+	echo
+	echo -e "You can now continue setting up instances as explained on the website:"
+	echo -e "  https://7dtd.illy.bz/wiki/Instance%20management"
 	echo
 	echo -e "For further configuration options check:"
 	echo -e "  /etc/7dtd.conf"
-	echo -e "  /home/sdtd/serverconfig.xml"
-	echo
-	echo -e "For feedback, suggestions, problems please visit the forum:"
-	echo -e "  http://7daystodie.com/forums/showthread.php?2188"
+	echo
+	echo -e "For feedback, suggestions, problems please visit the bugtracker:"
+	echo -e "  https://7dtd.illy.bz/"
 	echo
 }
@@ -202,8 +184,8 @@
 	nonDebianWarning
 
-	if [[ $ISDEBIAN == 1 ]]; then
+	if [ $ISDEBIAN -eq 1 ]; then
 		installAptDeps
-		if [[ $INSTALLOPTIONALDEPS == 1 ]]; then
-			installOptionalDeps
+		if [ $INSTALLOPTIONALDEPS -eq 1 ]; then
+#			installOptionalDeps
 			echo
 		fi
@@ -213,12 +195,11 @@
 	setSteamLoginData
 	installSteamCmdAndSDTD
-	if [[ $ADDCRONJOBS == 1 ]]; then
+	if [ $ADDCRONJOBS -eq 1 ]; then
 		addCronJobs
 	fi
-	setupServerConfig
 	finish
 }
 
-if [[ -z $1 ]]; then
+if [ -z $1 ]; then
 	showHelp
 	exit 0
@@ -241,5 +222,5 @@
 	esac
 done
-if [[ $RUNINSTALL == 1 ]]; then
+if [ $RUNINSTALL -eq 1 ]; then
 	main
 fi
