Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- #!/bin/bash
- if [[ $EUID > 0 ]]
- then echo "Please run as root"
- exit
- fi
- if [ -z "$1" ]
- then echo "Please set game server"
- echo "Usage:"
- echo "./lgsm.sh zpsserver"
- exit
- fi
- yum -y -q install mailx postfix curl wget bzip2 gzip unzip python binutils bc tmux glibc.i686 libstdc++ libstdc++.i686 ncurses-libs.i686 file sudo
- getent passwd $1 > /dev/null 2&>1
- if [[ $? == 0 ]]
- then echo "User exists"
- else
- echo "Creating user"
- pass=`tr -cd a-zA-Z0-9 < /dev/urandom | head -c 12`
- adduser $1
- echo $pass | passwd $1 --stdin
- fi
- exec sudo -u $1 /bin/bash << EOF
- cd
- wget https://linuxgsm.com/dl/linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh $1
- ./$1 auto-install
- echo "Username $1"
- echo "Password $pass"
- echo "Do not lose this"
- EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement