Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- STPATH=$HOME; #Repertoire d'installation
- SCRIPTDIR=$STPATH/script; #Localisation du rep script
- DEFAULT_BANTIME=1440; #Duree du ban par defaut
- cd $HOME/script/config/conf
- . ./admin.conf
- isBanned()
- {
- STEAM_DROP=$1;
- if [ "`cat $GAMES_SERVDIR/banned_user.cfg | grep $STEAM_DROP`" = "" ]; then
- echo "0";
- else
- echo "1";
- fi
- }
- bann()
- {
- STEAM_DROP=$1;
- BANTIME=$2;
- cd $GAMES_SERVDIR
- $MASTER_RCON
- RCON=`cat $CFPATH/$DSCONF | sed -e 's/\"//g' | grep "rcon_password" | awk -F "rcon_password" '{ print $2 }'`
- /usr/bin/python $SCRIPTDIR/cron/rcon.py $DSIP $DSPORT $RCON banid $BANTIME $STEAM_DROP
- /usr/bin/python $SCRIPTDIR/cron/rcon.py $DSIP $DSPORT $RCON writeid
- wait
- }
- ################################################################################
- # Tests de base
- ################################################################################
- # On verifie qu'un steam ID a bien ete passe
- if [ -z $1 ];
- then
- return 1;
- fi
- STEAM_ID=$1;
- # On verifie que le steam ID n'est pas deja banni
- STATUS=$(isBanned $STEAM_ID)
- if [ $STATUS = "1" ];
- then
- return 2;
- fi
- # Si aucune duree n'est donnee, on met celle par defaut
- if [ -z $2 ];
- then
- BANTIME=$DEFAULT_BANTIME;
- else
- BANTIME=$2;
- fi
- ################################################################################
- # Tout est bon, on peut ban
- bann $STEAM_ID $BANTIME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement