mirror of
https://github.com/wireadmin/wireadmin
synced 2025-01-23 12:27:00 +00:00
17 lines
351 B
Bash
17 lines
351 B
Bash
#!/bin/bash
|
|
|
|
# This script is used for getting last 100 lines of a screen session
|
|
|
|
SCREEN_NAME="$1"
|
|
LIMIT="${2:-100}"
|
|
SCRIPT=$(basename "${0}")
|
|
|
|
if [ -z "$SCREEN_NAME" ]; then
|
|
echo "Usage: ${SCRIPT} <screen_name>"
|
|
exit 1
|
|
fi
|
|
|
|
screen -S "$SCREEN_NAME" -X hardcopy /tmp/screen-hardcopy
|
|
tail -n "${LIMIT}" /tmp/screen-hardcopy
|
|
rm /tmp/screen-hardcopy
|