1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-12-22 06:15:50 +00:00

Addressed whines from "shellcheck -s sh"

This commit is contained in:
Miles Goodhew 2023-01-25 23:57:32 +11:00
parent b4a7f21fdd
commit 5fd204f3df

View File

@ -1,4 +1,5 @@
#!/bin/bash
#!/usr/bin/dash
#!/bin/sh
#
SCRIPT_NAME="save-log.sh"
#
@ -12,7 +13,7 @@ SCRIPT_NAME="save-log.sh"
#
# $ sudo ./edit-options.sh
#
if [[ $EUID -ne 0 ]]; then
if [ "$(id -u)" -ne 0 ]; then
echo "You must run this script with superuser (root) privileges."
echo "Try: \"sudo ./${SCRIPT_NAME}\""
exit 1
@ -24,7 +25,7 @@ rm -f -- rtw.log
dmesg | cut -d"]" -f2- | grep "RTW" >> rtw.log
RESULT=$?
if [[ "$RESULT" != "0" ]]; then
if [ "$RESULT" != "0" ]; then
echo "An error occurred while running: ${SCRIPT_NAME}"
echo "Did you set a log level > 0 ?"
exit 1