Path: blob/master/ALFA-W1F1/RTL8814AU/save-log.sh
1306 views
#!/bin/sh12# Purpose: Save a log file with RTW lines only.3#4# To make this file executable:5#6# $ chmod +x save-log.sh7#8# To execute this file:9#10# $ sudo ./save-log.sh11#12# or13#14# $ sudo sh save-log.sh1516SCRIPT_NAME="save-log.sh"1718if [ "$(id -u)" -ne 0 ]; then19echo "You must run this script with superuser (root) privileges."20echo "Try: \"sudo ./${SCRIPT_NAME}\""21exit 122fi2324# deletes existing log25rm -f -- rtw.log2627dmesg | cut -d"]" -f2- | grep "RTW" >> rtw.log28RESULT=$?2930if [ "$RESULT" != "0" ]; then31echo "An error occurred while running: ${SCRIPT_NAME}"32echo "Did you set a log level > 0 ?"33exit 134else35echo "rtw.log saved successfully."36fi373839