diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/i-data-admin.sh | 93 | ||||
-rwxr-xr-x | scripts/i-data-boards-openings.sh | 45 | ||||
-rwxr-xr-x | scripts/i-data-book.sh | 40 | ||||
-rwxr-xr-x | scripts/i-data-help.sh | 219 | ||||
-rwxr-xr-x | scripts/i-data-index.sh | 45 | ||||
-rwxr-xr-x | scripts/i-data-lists.sh | 71 | ||||
-rwxr-xr-x | scripts/i-data-messages.sh | 49 | ||||
-rwxr-xr-x | scripts/i-data-stats.sh | 35 | ||||
-rwxr-xr-x | scripts/i-data-usage.sh | 131 | ||||
-rwxr-xr-x | scripts/i-data-uscf.sh | 88 | ||||
l--------- | scripts/i-games-adjourned.sh | 1 | ||||
-rwxr-xr-x | scripts/i-games-history.sh | 39 | ||||
l--------- | scripts/i-games-journal.sh | 1 | ||||
-rwxr-xr-x | scripts/i-players.sh | 31 |
14 files changed, 888 insertions, 0 deletions
diff --git a/scripts/i-data-admin.sh b/scripts/i-data-admin.sh new file mode 100755 index 0000000..4e01a6c --- /dev/null +++ b/scripts/i-data-admin.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_admin () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + +# adjrequests -> ../stats/player_data/a/adjudicate.messages +# amotd -> ../messages/admotd* +# bug -> ../stats/player_data/b/bug.messages +# computerlist -> ../stats/player_data/c/computerlist.messages +# events -> ../stats/player_data/e/event.messages +# filtered -> ../stats/player_data/f/filter.messages +# helpfiles -> ../stats/player_data/h/helpfiles.messages +# multiaccounts -> ../stats/player_data/m/multiaccounts.messages +# suggestion -> ../stats/player_data/s/suggestion.messages +# vacation -> ../stats/player_data/v/vacation.messages + _files=" +accounts +addaccounts +addcomment +addplayer +adjudicate +adjud_info +admin +admin_commands +admin_hierarchy +ahelp +anews +announce +annunreg +asetadmin +asetblitz +asetemail +asethandle +asetmaxplayer +asetpasswd +asetrealname +asetstd +asetv +asetwild +ban +buglist +canewsf +canewsi +chkgame +chkip +chkpl +chksc +chkts +cmuzzle +cnewsf +cnewsi +createanews +filter +finger +lists +muzzle +nuke +pose +projects +quota +raisedead +register +remplayer +rerank +server_com +showcomment +shutdown +summon +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_admin "${1}" "${2}" diff --git a/scripts/i-data-boards-openings.sh b/scripts/i-data-boards-openings.sh new file mode 100755 index 0000000..30d3518 --- /dev/null +++ b/scripts/i-data-boards-openings.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_boards_openings () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + + _files=" +double-d-pawn +double-e-pawn +giouco-piano +kings-gambita +kings-gambita-be7 +kings-gambita-fischer +kings-gambita-nc6 +kings-gambita-schallop +kings-gambitd-bc5 +kings-gambitd-d6 +kings-gambitd-falkbeer +kings-gambitd-nf6 +kings-gambitd-nimzo +ruy-lopez +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_boards_openings "${1}" "${2}" diff --git a/scripts/i-data-book.sh b/scripts/i-data-book.sh new file mode 100755 index 0000000..5e45ec3 --- /dev/null +++ b/scripts/i-data-book.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_book () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + +# eco000.idx +# long001.idx +# nic000.idx + _files=" +changes.txt +eco999.idx +fen.doc +long999.idx +nic999.idx +opening.doc +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_book "${1}" "${2}" diff --git a/scripts/i-data-help.sh b/scripts/i-data-help.sh new file mode 100755 index 0000000..38ece7a --- /dev/null +++ b/scripts/i-data-help.sh @@ -0,0 +1,219 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_help () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + +# login -> ../messages/login* +# logout -> ../messages/logout* +# motd -> ../messages/motd* +# newstuff -> /home/chess/FICS/5001/README.NEW +# register.dist* + _files=" +abort +abuser +accept +addlist +addresses +adjourn +adjournments +adjudication +adm_info +admins +adm_new +alias +allobservers +analysis +assess +backward +bell +best +blindfold +blitz +boards +bughouse +bughouse_not +bughouse_strat +busy +censor +chan_1 +channel +channel_list +clearmessages +cls +cls_info +commands +computers +convert_bcf +convert_elo +convert_uscf +courtesyabort +credit +cshout +date +decline +draw +eco +eggo +etiquette +examine +ficsfaq +fics_lingo +finger +fixes +flag +flip +formula +forward +ftp_hints +games +glicko +gm_game +gnotify +goboard +gonum +handle +handles +hbest +_help +help +highlight +history +hrank +inchannel +index +inetchesslib +interfaces +intro_basics +intro_general +intro_information +intro_moving +intro_playing +intro_settings +intro_special +intro_talking +intro_welcome +it +journal +jsave +kibitz +kiblevel +lag +lecture1 +lightning +limits +lists +llogons +logons +mailhelp +mailmess +mailmoves +mailoldmoves +mailsource +mailstored +match +messages +mexamine +moretime +motd_help +moves +newrating +news +next +noplay +notes +notify +observe +oldmoves +open +partner +password +pause +pending +policy +prefresh +private +promote +ptell +quit +rank +ratings +refresh +register +resign +revert +say +servers +set +shout +shout_abuse +shout_quota +showlist +simabort +simadjourn +simallabort +simalladjourn +simgames +simmatch +simnext +simopen +simpass +simprev +simuls +smoves +soapbox +sourcecode +sposition +standard +statistics +stored +style +sublist +switch +takeback +team +teamgames +tell +time +timeseal +totals +unalias +unexamine +unobserve +unpause +untimed +uptime +uscf_faq +variables +wcmatch +whenshut +whisper +who +wild +withdraw +xtell +znotify +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_help "${1}" "${2}" diff --git a/scripts/i-data-index.sh b/scripts/i-data-index.sh new file mode 100755 index 0000000..38740b4 --- /dev/null +++ b/scripts/i-data-index.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_index () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + + _files=" +all +analysis +commands +game_info +help +_index +mail +play +preferences +server_info +simul +special +talk +user_info +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_index "${1}" "${2}" 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}" diff --git a/scripts/i-data-messages.sh b/scripts/i-data-messages.sh new file mode 100755 index 0000000..5ab631c --- /dev/null +++ b/scripts/i-data-messages.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023, 2024 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_messages () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + +# welcome.backup +# welcome.old + _files=" +admotd +login +logout +logout.fancy +motd +unregistered +welcome +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + + if [ -r "${_src_prefix}/${file}" ]; then + if [ -r "${_dest}/${file}" ]; then + echo "already exists (not overwriting)" + diff -u -w \ + "${_dest}/${file}" "${_src_prefix}/${file}" + continue + fi + + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_messages "${1}" "${2}" diff --git a/scripts/i-data-stats.sh b/scripts/i-data-stats.sh new file mode 100755 index 0000000..be49516 --- /dev/null +++ b/scripts/i-data-stats.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_stats () { + local _path _files + + _path="${1}" + _files=" +logons.log +newratingsV2_data +rank.blitz +rank.lightning +rank.std +rank.wild +" + + echo "installing..." + + 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_stats "${1}" diff --git a/scripts/i-data-usage.sh b/scripts/i-data-usage.sh new file mode 100755 index 0000000..a29951b --- /dev/null +++ b/scripts/i-data-usage.sh @@ -0,0 +1,131 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_usage () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + + _files=" +abort +accept +addlist +adjourn +alias +allobservers +assess +backward +bell +best +boards +censor +channel +clearmessages +cshout +date +decline +draw +eco +examine +finger +flag +flip +forward +games +goboard +gonum +handles +hbest +history +hrank +inchannel +it +kibitz +limits +llogons +logons +mailhelp +mailmess +mailmoves +mailoldmoves +mailsource +mailstored +match +messages +mexamine +moretime +moves +news +next +notify +observe +oldmoves +open +password +pause +pending +promote +quit +rank +refresh +resign +revert +say +set +shout +showlist +simabort +simadjourn +simallabort +simalladjourn +simgames +simmatch +simnext +simopen +simpass +simprev +smoves +sposition +statistics +stored +style +sublist +switch +takeback +tell +time +unalias +uncensor +unexamine +unnotify +unobserve +unpause +uptime +variables +whisper +who +withdraw +xtell +znotify +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_usage "${1}" "${2}" diff --git a/scripts/i-data-uscf.sh b/scripts/i-data-uscf.sh new file mode 100755 index 0000000..635c7fe --- /dev/null +++ b/scripts/i-data-uscf.sh @@ -0,0 +1,88 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_uscf () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + + _files=" +ak +al +ar +az +beginner +ca_n +ca_s +co +ct +dc +de +fl +foreign +ga +gran_prix +help +hi +ia +id +il +in +ks +ky +la +ma +md +me +mi +mn +mo +ms +mt +national +nc +nd +ne +nh +nj +nm +nv +ny +oh +ok +or +pa +ri +sc +sd +tn +tx +ut +va +vt +wa +wi +wv +wy +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_uscf "${1}" "${2}" diff --git a/scripts/i-games-adjourned.sh b/scripts/i-games-adjourned.sh new file mode 120000 index 0000000..6561cf9 --- /dev/null +++ b/scripts/i-games-adjourned.sh @@ -0,0 +1 @@ +i-players.sh
\ No newline at end of file diff --git a/scripts/i-games-history.sh b/scripts/i-games-history.sh new file mode 100755 index 0000000..c8c035e --- /dev/null +++ b/scripts/i-games-history.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_games_history () { + local _path _dirs + + _path="${1}" + _dirs=" +0 1 2 3 4 5 6 7 8 9 10 +11 12 13 14 15 16 17 18 19 20 +21 22 23 24 25 26 27 28 29 30 +31 32 33 34 35 36 37 38 39 40 +41 42 43 44 45 46 47 48 49 50 +51 52 53 54 55 56 57 58 59 60 +61 62 63 64 65 66 67 68 69 70 +71 72 73 74 75 76 77 78 79 80 +81 82 83 84 85 86 87 88 89 90 +91 92 93 94 95 96 97 98 99 +" + + echo "installing..." + + for dir in ${_dirs}; do + printf "creating '%s': " "${_path}/${dir}" + if [ -d "${_path}/${dir}" ]; then + echo "already exists (good)" + else + install -d "${_path}/${dir}" + if [ $? -eq 0 ]; then + echo "done" + else + echo "error" + fi + fi + done +} + +i_games_history "${1}" diff --git a/scripts/i-games-journal.sh b/scripts/i-games-journal.sh new file mode 120000 index 0000000..6561cf9 --- /dev/null +++ b/scripts/i-games-journal.sh @@ -0,0 +1 @@ +i-players.sh
\ No newline at end of file diff --git a/scripts/i-players.sh b/scripts/i-players.sh new file mode 100755 index 0000000..f61f330 --- /dev/null +++ b/scripts/i-players.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_players () { + local _path _dirs + + _path="${1}" + _dirs=" +a b c d e f g h i j k l m +n o p q r s t u v w x y z +" + + echo "installing..." + + for dir in ${_dirs}; do + printf "creating '%s': " "${_path}/${dir}" + if [ -d "${_path}/${dir}" ]; then + echo "already exists (good)" + else + install -d "${_path}/${dir}" + if [ $? -eq 0 ]; then + echo "done" + else + echo "error" + fi + fi + done +} + +i_players "${1}" |