aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/i-data-stats.sh
blob: 311b0ad0e1532d1dd4b0b053cefcb5aac683403f (plain)
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
#!/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.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}"