Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/save-log.sh
1306 views
1
#!/bin/sh
2
3
# Purpose: Save a log file with RTW lines only.
4
#
5
# To make this file executable:
6
#
7
# $ chmod +x save-log.sh
8
#
9
# To execute this file:
10
#
11
# $ sudo ./save-log.sh
12
#
13
# or
14
#
15
# $ sudo sh save-log.sh
16
17
SCRIPT_NAME="save-log.sh"
18
19
if [ "$(id -u)" -ne 0 ]; then
20
echo "You must run this script with superuser (root) privileges."
21
echo "Try: \"sudo ./${SCRIPT_NAME}\""
22
exit 1
23
fi
24
25
# deletes existing log
26
rm -f -- rtw.log
27
28
dmesg | cut -d"]" -f2- | grep "RTW" >> rtw.log
29
RESULT=$?
30
31
if [ "$RESULT" != "0" ]; then
32
echo "An error occurred while running: ${SCRIPT_NAME}"
33
echo "Did you set a log level > 0 ?"
34
exit 1
35
else
36
echo "rtw.log saved successfully."
37
fi
38
39