Linux Question
Hi.
I'm using gameservermanager's script for host the servers. I have 3 server, and i want to start or restart all of them in 1 command. But; for make this, i have to switch user. For example, Code:
su - server1 I tried wrote them in a .sh file, but failed. Thanks for helps.. |
Re: Linux Question
Quote:
Code:
ls /home/server1/csgoserver If you are in the current directory "/tmp/testing/" with root, and you do "su -" to the user "fish", then a new shell will be started and you will be switched to the new user's home directory, e.g. "/home/fish". |
Re: Linux Question
I would create a script as root and add the following...changing a needed. Or to run a non root make the 3 users part of the same group and update the permissions to include the group somthing like chown -R server1:gameservers '/home/username/
su - username -c '/home/username/gameserver restart' |
Re: Linux Question
The documentation exists already: https://github.com/dgibbs64/linuxgsm/wiki/Automation
Root Cron Job Example Code:
0 5 * * * su - csgoserver -c '/home/csgoserver/csgoserver restart' > /dev/null 2>&1 |
Re: Linux Question
Quote:
|
Re: Linux Question
Quote:
|
Re: Linux Question
I made a start.sh with them,
Code:
su - server1 -c '/home/server1/csgoserver start' Code:
@reboot /root/start.sh Thanks for helps.. |
All times are GMT -4. The time now is 09:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.