Jump to content
View in the app

A better way to browse. Learn more.

Forum Supreme-Elite

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Scripts start reboot update serveur global offensive

Featured Replies

Ici vous allez trouvez un script de tomidefix qui va vous permettre

  1. start
     
  2. stop
     
  3. update
     
  4. restart
     
  5. status

Pensez aussi a modifiez le script ;)

 

 

 

#!/bin/sh
# /etc/init.d/srv-manager
### BEGIN INIT INFO
# Provides: srv-manager
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: srv-manager
# Description: Init script for csgo
### END INIT INFO

#############################################
## Global Config
#############################################
# Linux
############
LINUX_USER='game'
LINUX_SCREENNAME='serveurcsgo'
LINUX_PATH_SERVER='/home/game/steam/csgo-deagle'
LINUX_PATH_STEAMCMD='/home/game/steam/SteamCmd'
############
# Steam
############
STEAM_LOGIN='loginsteam'
STEAM_PASSWORD='passwd'
############
# Game
############
GAME_NAME="csgo"
GAME_FPS="1000"
GAME_MODE="0"
GAME_TYPE="0"
# +Map
GAME_MAP_GROUP="deagle"
GAME_MAP="aim_deagle_hangar"
# +Network
GAME_IP="46.105.39.67"
GAME_PORT="27035"

#############################################
## CMD
#############################################
STEAMCMD="+login ${STEAM_LOGIN} ${STEAM_PASSWORD} +force_install_dir ${LINUX_PATH_SERVER} +app_update 740 validate +exit"

SRCDSCMD="./srcds_run -game ${GAME_NAME} -console -usercon -ip ${GAME_IP} -port ${GAME_PORT} +fps_max ${GAME_FPS} +game_type ${GAME_TYPE} +game_mode ${GAME_MODE} +mapgroup ${GAME_MAP_GROUP} +map ${GAME_MAP}"
#############################################
## FONC
#############################################
# as_user
ME=`whoami`
as_user() {
if [ $ME == $LINUX_USER ] ; then
bash -c "$1"
else
su $LINUX_USER -s /bin/bash -c "$1"
fi
}
is_running(){
if ps ax | grep -v grep | grep "$LINUX_SCREENNAME $SRCDSCMD" > /dev/null
then
return 0
fi
return 1
}
srv_start() {
cd $LINUX_PATH_SERVER
as_user "cd $LINUX_PATH_SERVER && screen -dmS $LINUX_SCREENNAME $SRCDSCMD"
#
# Waiting for the server to start
#
seconds=0
sleep 2
until ps ax | grep -v grep | grep "$LINUX_SCREENNAME $SRCDSCMD" > /dev/null
do
sleep 1
seconds=$seconds+1
if [[ $seconds -eq 5 ]]
then
echo "Still not running, waiting a while longer..."
fi
if [[ $seconds -ge 120 ]]
then
echo "Failed to start, aborting."
exit 1
fi
done
echo "$LINUX_SCREENNAME is running."
}
srv_stop() {
#
# Stops the server
#
as_user 'screen -dr ${LINUX_SCREENNAME} -X quit'
}
srv_command() {
 if is_running
 then
as_user "screen -p 0 -S $LINUX_SCREENNAME -X eval 'stuff \"$(eval echo $1)\"\015'"
 else
echo "$LINUX_SCREENNAME was not running. Not able to run command."
 fi
}
srv_say() {
if is_running
then
echo "Said: $1"
srv_command "say $1"
else
echo "$LINUX_SCREENNAME was not running. Not able to say anything."
fi
}
srv_update(){
cd $LINUX_PATH_STEAMCMD
as_user "STEAMEXE=steamcmd ./steam.sh +login ${STEAM_LOGIN} ${STEAM_PASSWORD} +force_install_dir ${LINUX_PATH_SERVER} +app_update 740 +exit"
}
#############################################
## SCRIPT
#############################################
case "$1" in
#######################
# START
#######################
'start')
# Starts the server
if is_running; then
echo "Server already running."
else
srv_start
fi
;;
#######################
# STOP
#######################
'stop')
# Stops the server
if is_running; then
srv_say "SERVER SHUTTING DOWN!"
sleep 2
srv_stop
else
echo "No running server."
fi
;;
#######################
# RESTART
#######################
'restart')
# Restarts the server
if is_running; then
srv_say "SERVER REBOOT IN 10 SECONDS!"
sleep 10
srv_stop
else
echo "No running server, starting it..."
fi
srv_start
;;
#######################
# UPDATE
#######################
'update')
# update server
if is_running; then
srv_say "SERVER UPDATE IN 10 SECONDS."
sleep 10
srv_stop
to_disk
srv_update
else
srv_update
fi
;;
#######################
# STATUS
#######################
'status')
# Shows server status
if is_running
then
echo "$LINUX_SCREENNAME is running."
else
echo "$LINUX_SCREENNAME is not running."
fi
;;
#######################
# NOT FOUND CMD
#######################
*)
echo "Usage: $0 { start | stop | restart | update | status }"
;;

esac
exit 0

 

 

exemple de fonctionnement

 

./srv-magager.sh start
./srv-magager.sh stop
./srv-magager.sh update
./srv-magager.sh status
./srv-magager.sh update

  • 3 months later...

bonjour apres installation du script je ne comprend pas comment voir si cela fonctionne ou pas pourrais tu m aider?

merci bien

En te plaçant dans le dossier tu marque dans ton ssh :

./srv-magager.sh start
./srv-magager.sh stop
./srv-magager.sh update
./srv-magager.sh status
./srv-magager.sh update

pour l installation car je pense que j ai du me chier comment faut il faire stp car si j ai compris il faut cree deux dossier un dans

 

#!/bin/sh

 

# /etc/init.d/srv-manager

 

mais il faut les mettre en point quoi

 

merci de ton aide

Edited by sam31

Fait toi plaisir pour noël -> http://www.amazon.fr...2016/ref=sr_1_3

 

Bon sinon, /bin/sh n'est pas un dossier, c'est un binaire. N'essai pas d'écrire dedans, ta machine risquerai de ne plus démarrer correctement...

 

Le script plus haut, tu le met dans un nouveau fichier : /etc/init.d/srv-manager

Tu rends ce fichier executable : chmod +x /etc/init.d/srv-manager

 

Ensuite tu peux utiliser les 5 commandes présentées plus haut :

/etc/init.d/srv-manager status

pourrais tu m expliquer comment faire pour rendre srv-manager exécutable a partir de src-manager stp

 

car a chaque fois que je tape "/etc/init.d/src-manager status"

voila se que j obtiens

/etc/init.d/src-manager: line 1: ./srv-manager.sh: No such file or directory

/etc/init.d/src-manager: line 2: ./srv-manager.sh: No such file or directory

/etc/init.d/src-manager: line 3: ./srv-manager.sh: No such file or directory

/etc/init.d/src-manager: line 4: ./srv-manager.sh: No such file or directory

/etc/init.d/src-manager: line 5: ./srv-manager.sh: No such file or directory

 

merci de ton aide

Edited by sam31

Erreur de frappe, j'ai modifié mon post...

Il n'y a pas de src-manager, il n'y a QUE srv-manager

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.