func (s *Server) Reinstall() error {
	if s.Environment.State() != environment.ProcessOfflineState {
		s.Log().Debug("waiting for server instance to enter a stopped state")
		if err := s.Environment.WaitForStop(10, true); err != nil {
			return err
		}
	}
	return s.Install(true)
}
Reinstalls a server's software by utilizing the install script for the server egg. This
does not touch any existing files for the server, other than what the script modifies.
package server
import (
	"bufio"
	"bytes"
	"context"
	"html/template"
	"io"
	"os"
	"path/filepath"
	"strconv"
	"strings"
	"emperror.dev/errors"
	"github.com/apex/log"
	"github.com/docker/docker/api/types"
	"github.com/docker/docker/api/types/container"
	"github.com/docker/docker/api/types/mount"
	"github.com/docker/docker/client"
	"github.com/pterodactyl/wings/config"
	"github.com/pterodactyl/wings/environment"
	"github.com/pterodactyl/wings/remote"
	"github.com/pterodactyl/wings/system"
)
func (s *Server) Install(sync bool) error {
	if sync {
		s.Log().Info("syncing server state with remote source before executing installation process")
		if err := s.Sync(); err != nil {
			return err
		}
	}
	var err error
	if !s.Config().SkipEggScripts {
		s.Events().Publish(InstallStartedEvent, "")
		err = s.internalInstall()
	} else {
		s.Log().Info("server configured to skip running installation scripts for this egg, not executing process")
	}
	s.Log().WithField("was_successful", err == nil).Debug("notifying panel of server install state")
	if serr := s.SyncInstallState(err == nil); serr != nil {
		l := s.Log().WithField("was_successful", err == nil)
		if err == nil {
			l.WithField("error", serr)
		}
		l.Warn("failed to notify panel of server install state")
	}
	s.Environment.SetState(environment.ProcessOfflineState)
	s.Events().Publish(InstallCompletedEvent, "")
	return err
}