Plaster
New
List
Login
text
default
shinmera
1946.12.22 20:24:03
#!/bin/bash readonly DEFAULT_DIRECTORY=$(dirname "$(readlink -f "$0")") readonly DEFAULT_FILE=index.html ## readonly DIRECTORY=${1:-$DEFAULT_DIRECTORY} readonly FILE=${2:-$DEFAULT_FILE} function convert-files-to-links() { local links=() for file in "$@"; do local filename=$(basename "$file") links+=("<a href=\"$filename\">$filename</a>") done echo "${links[@]}" } function write-index() { local index="$1" local files=( "${@:2}" ) local links=$(convert-files-to-links "${files[@]}") cat >"$index" <<EOF <!DOCTYPE html> <html> <head> <title>Map File Listing</title> </head> <body> ${links[@]} </body> </html> EOF } function main() { shopt -s nullglob local files=("$DIRECTORY"/*.{wad,pk3}) shopt -u nullglob write-index "$DIRECTORY/$FILE" "${files[@]}" } main
Raw
Annotate
Repaste
Annotations
text
default
shinmera
1946.12.22 20:35:41
#!/bin/bash readonly ROOT=~/zandronumDS/ readonly CORE_LOCATION="$ROOT/core/" readonly MAPS_LOCATION="$ROOT/pwads/" readonly CONFIG_FILE="$ROOT/config/server.cfg" readonly LAUNCH_OPTIONS=(-host -useip 0.0.0.0 -port 10666 -iwad doom2.wad +exec "$CONFIG_FILE" +cooperative 1 +masterhostname master.zandronum.com:15300) ## function launch() { local maps=("$@") cd "$CORE_LOCATION" ./zandronum-server \ "${LAUNCH_OPTIONS[@]}" \ -file "${maps[@]}" } function main() { local maps=("$MAPS_LOCATION"/*.wad) launch "${maps[@]}" }
Raw
Repaste
text
default
shinmera
1946.12.22 21:12:40
#!/bin/bash readonly ROOT=~/zandronumDS/ readonly CORE_LOCATION="$ROOT/core/" readonly MAPS_LOCATION="$ROOT/pwads/" readonly CONFIG_FILE="$ROOT/config/server.cfg" readonly LAUNCH_OPTIONS=(-host -useip 0.0.0.0 -port 10666 -iwad doom2.wad +exec "$CONFIG_FILE" +cooperative 1 +masterhostname master.zandronum.com:15300) ## function launch() { cd "$CORE_LOCATION" ./zandronum-server \ "${LAUNCH_OPTIONS[@]}" \ -file "file" "file" "file" } launch
Raw
Repaste