add command for reading logs. Usage: logs <service>

This commit is contained in:
Shahrad Elahi 2023-12-19 13:28:29 +03:30
parent 3fdb21d8d7
commit fac671821a

13
bin/logs Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
LOG_DIR="/var/vlogs"
LOG_FILE="${LOG_DIR}/${1}"
if [ ! -f "${LOG_FILE}" ]; then
echo "Usage: ${0} <filename>"
exit 1
fi
cat "${LOG_FILE}"