From d74ed63b49802a8d5c4f5641dff6e1a6f28383ad Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sat, 23 Dec 2023 00:03:37 +0100 Subject: i-data-lists.sh -- initial revision --- scripts/i-data-lists.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 scripts/i-data-lists.sh diff --git a/scripts/i-data-lists.sh b/scripts/i-data-lists.sh new file mode 100755 index 0000000..9338e87 --- /dev/null +++ b/scripts/i-data-lists.sh @@ -0,0 +1,71 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin +# SPDX-License-Identifier: ISC + +i_data_lists () { + local _path _files + + _path="${1}" + +# HelpToIndex +# index +# README + _files=" +abuser +admin +ban +blind +cmuzzle +computer +filter +fm +gm +im +muzzle +programmer +removedcom +td +teams +" + + echo "installing..." + + if [ ! -r "${_path}/index" ]; then + cat < "${_path}/index" +abuser 0 +admin -1 +ban 0 +blind 1 +cmuzzle 0 +computer 1 +filter 0 +fm 1 +gm 1 +im 1 +muzzle 0 +programmer -1 +removedcom -1 +td -1 +teams 1 +EOF + if [ $? -eq 0 ]; then + echo "created ${_path}/index" + fi + fi + + for file in ${_files}; do + printf "creating '%s': " "${_path}/${file}" + if [ -r "${_path}/${file}" ]; then + echo "already exists (good)" + else + cat /dev/null > "${_path}/${file}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + fi + done +} + +i_data_lists "${1}" -- cgit v1.2.3