retab and add +x permission on start/stop scripts

This commit is contained in:
Mathew Guest 2021-10-06 04:20:54 -06:00
parent 586aa9a1dc
commit d018a8d9dd

@ -200,12 +200,14 @@ rsync -rvz \
engineini="/srv/ut4-redirect.zavage.net/config/Engine.ini"
cmd = '''
ssh mathewguest.com sed -i /ServerInstanceID=/c\ServerInstanceID=Hidden {gameini}
ssh mathewguest.com \
sed -i /ServerInstanceID=/c\ServerInstanceID=Hidden {gameini}
'''.format(gameini=gameini)
self._invoke_command(cmd)
cmd = '''
ssh mathewguest.com sed -i /RconPassword=/c\RconPassword=Hidden {engineini}
ssh mathewguest.com \
sed -i /RconPassword=/c\RconPassword=Hidden {engineini}
'''.format(engineini=engineini)
self._invoke_command(cmd)
@ -213,7 +215,9 @@ ssh mathewguest.com sed -i /RconPassword=/c\RconPassword=Hidden {engineini}
project_dir = self.ctx.config['app']['project_dir']
remote_redirect_host = self.ctx.config['app']['remote_redirect_host']
cmd = '''
rsync -vz {project_dir}/ut4-server-ctl.sh {remote_redirect_host}
rsync -vz \
{project_dir}/ut4-server-ctl.sh \
{remote_redirect_host}
'''\
.format(**{
'project_dir': project_dir,
@ -227,7 +231,8 @@ rsync -vz {project_dir}/ut4-server-ctl.sh {remote_redirect_host}
remote_redirect_host = self.ctx.config['app']['remote_redirect_host']
cmd = '''
ssh mathewguest.com 'chown http.http /srv/ut4-redirect.zavage.net -R'
ssh mathewguest.com \
chown http.http /srv/ut4-redirect.zavage.net -R
'''
self._invoke_command(cmd)
@ -268,7 +273,9 @@ rsync -ravzp \
# transfer #2
cmd = '''
rsync -avzp {project_dir}/ut4-server-ctl.sh {remote_game_host}:{remote_game_dir}
rsync -avzp \
{project_dir}/ut4-server-ctl.sh \
{remote_game_host}:{remote_game_dir}
'''\
.format(**{
'project_dir': project_dir,
@ -280,7 +287,9 @@ rsync -avzp {project_dir}/ut4-server-ctl.sh {remote_game_host}:{remote_game_dir}
# transfer #3
cmd = '''
scp {project_dir}/instance/ut4-server.service {remote_game_host}:/etc/systemd/system/
scp \
{project_dir}/instance/ut4-server.service \
{remote_game_host}:/etc/systemd/system/
'''\
.format(**{
'project_dir': project_dir,
@ -292,7 +301,24 @@ scp {project_dir}/instance/ut4-server.service {remote_game_host}:/etc/systemd/sy
# transfer #4
cmd = '''
ssh {remote_game_host} chown ut4.ut4 {remote_game_dir} -R
ssh {remote_game_host} \
chown ut4.ut4 {remote_game_dir} -R
'''.format(**{
'remote_game_host': remote_game_host,
'remote_game_dir': remote_game_dir
})
# subprocess.run(cmd, cwd=cwd)
self._invoke_command(cmd)
# Fix +x permissions on bash scripts
cmd = '''
ssh {remote_game_host} \
chmod +x \
{remote_game_dir}/start-server.sh \
{remote_game_dir}/stop-server.sh
'''.format(**{
'remote_game_host': remote_game_host,
'remote_game_dir': remote_game_dir