Skip to content

Commit

Permalink
Merge pull request #802 from cazfi/posixshebang
Browse files Browse the repository at this point in the history
Replace #!/bin/bash with posix compliant shebang
  • Loading branch information
cazfi authored Jan 7, 2024
2 parents 2996983 + b06400d commit a78a285
Show file tree
Hide file tree
Showing 28 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ EXPOSE 80 8080 4002 6000 6001 6002 7000 7001 7002

ENTRYPOINT ["/docker/docker-entrypoint.sh"]

CMD ["/bin/bash"]
CMD ["/usr/bin/env bash"]
2 changes: 1 addition & 1 deletion config/gen-from-templates.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Copyright (C) 2018 The Freeciv-web project
#
Expand Down
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

/docker/scripts/start-freeciv-web.sh

Expand Down
5 changes: 3 additions & 2 deletions freeciv-web/build-js.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# builds javascript files Freeciv-web and copies the resulting file to tomcat.
#!/usr/bin/env bash

# Builds javascript files Freeciv-web and copies the resulting file to tomcat.

FCW_DEST=/var/lib/tomcat10/webapps/freeciv-web

Expand Down
5 changes: 3 additions & 2 deletions freeciv-web/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# builds Freeciv-web and copies the war file to Tomcat.
#!/usr/bin/env bash

# Builds Freeciv-web and copies the war file to Tomcat.

BATCH_MODE=""

Expand Down
2 changes: 1 addition & 1 deletion freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Freeciv server version upgrade notes (backports)
# ------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion freeciv/dl_freeciv_default.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env -S bash -e

# Places the specified revision of Freeciv in freeciv/freeciv/
# This is the default. The script dl_freeciv.sh will run instead of
Expand Down
2 changes: 1 addition & 1 deletion freeciv/prepare_freeciv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "${DIR}"
Expand Down
5 changes: 3 additions & 2 deletions pbem/restart.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# nightly restart of PBEM process.
#!/usr/bin/env bash

# Nightly restart of PBEM process.

kill $(ps -ef | grep python| grep pbem | awk '{print $2}')
sleep 4
Expand Down
5 changes: 3 additions & 2 deletions publite2/init-freeciv-web.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /bin/bash
# starts freeciv-proxy and freeciv-web.
#!/usr/bin/env bash

# Starts freeciv-proxy and freeciv-web.
# This script is started by civlauncher.py in publite2.

if [ "$#" -ne 6 ]; then
Expand Down
2 changes: 1 addition & 1 deletion publite2/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

nohup python3 -u publite2.py > ../logs/publite2.log 2>&1 || tail -5 ../logs/publite2.log && sleep 5 &
2 changes: 1 addition & 1 deletion scripts/freeciv-img-extract/sync.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

resolve() { echo "$(cd "$1" >/dev/null && pwd)"; }
while [[ $# -gt 0 ]]; do
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpdata_gen/ruleset_auto_gen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Freeciv has code that generates certain help texts based on the ruleset.
# This code is written in C. It is huge. Replicating it in JavaScript would
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/dependency-services-default-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Start Freeciv-web's dependency services.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/dependency-services-default-stop.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Shutdown Freeciv-web's dependency services.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/dependency-services-systemd-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Use systemd to start the services Freeciv-web depends on.
# Need to start the dependency services in a different way to work with
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/dependency-services-systemd-stop.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Use systemd to stop the services Freeciv-web depends on.
# Need to start the dependency services in a different way to work with
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Copyright (C) 2018 The Freeciv-web project
#
Expand Down
5 changes: 3 additions & 2 deletions scripts/log-cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# cleans up logs
#!/usr/bin/env bash

# Cleans up logs

find /home/freeciv/freeciv-web/freeciv-web/logs/*.log -exec cp /dev/null {} \;
cp /dev/null /usr/local/nginx/logs/access.log
Expand Down
2 changes: 1 addition & 1 deletion scripts/migration/0001-update-python-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. >/dev/null && pwd)"

Expand Down
2 changes: 1 addition & 1 deletion scripts/migration/0002-local-handlebars.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. >/dev/null && pwd)"

Expand Down
2 changes: 1 addition & 1 deletion scripts/migration/migrate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Copyright (C) 2018 The Freeciv-web project
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/modpack-install/modpacks_install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Install modpacks listed in freeciv/modpackURLs.lst

Expand Down
2 changes: 1 addition & 1 deletion scripts/restart-tomcat.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

export JAVA_OPTS="-Djava.security.egd=file:/dev/urandom"
export CATALINA_HOME=/var/lib/tomcat10
Expand Down
3 changes: 2 additions & 1 deletion scripts/start-freeciv-web.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash

# Startup script for running all processes of Freeciv-web

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down
3 changes: 2 additions & 1 deletion scripts/status-freeciv-web.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash

# Checks status of various Freeciv-web processes

alias curl='stdbuf -i0 -o0 -e0 curl'
Expand Down
3 changes: 2 additions & 1 deletion scripts/stop-freeciv-web.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash

# Shutdown script for Freeciv-web

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync-js-hand.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# -Synchronizes the javascript packet handler (packhand_gen.js)
# with the definitions in packets.def.
Expand Down

0 comments on commit a78a285

Please sign in to comment.