diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-23 00:03:37 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-23 00:03:37 +0100 |
commit | d74ed63b49802a8d5c4f5641dff6e1a6f28383ad (patch) | |
tree | 999d56b7581a175053596f443c2da20a03ff13f7 /scripts | |
parent | c4050dac0de207769a46d647499a308ea001534e (diff) |
i-data-lists.sh -- initial revision
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/i-data-lists.sh | 71 |
1 files changed, 71 insertions, 0 deletions
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 <maxxe@rpblc.net> +# 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 <<EOF > "${_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}" |