From 936762415824df1bd9e6f410fdf2aa6178f9fe70 Mon Sep 17 00:00:00 2001 From: ricky Date: Fri, 4 Mar 2022 22:21:31 -0500 Subject: [PATCH] Use negate (#3) * use negate * fall through --- no-subscription-warning.sh | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) mode change 100644 => 100755 no-subscription-warning.sh diff --git a/no-subscription-warning.sh b/no-subscription-warning.sh old mode 100644 new mode 100755 index 34a7591..d1b802a --- a/no-subscription-warning.sh +++ b/no-subscription-warning.sh @@ -38,22 +38,23 @@ apply_razor1911_crack() { echo "attempting pve-no-subscription patch" -if [ -n "$ARG" ]; then - if [ "$ARG" == "--steamroll" ]; then - apply_razor1911_crack - else - echo "unrecognized option" - fi -else - if test -f "$FILE"; then - if grep -i "$FIND" "$FILE"; then - echo "subscription status: $FIND" - echo "attempting replacement in $FILE..." - apply_razor1911_crack - else - echo "pve appears to be patched." - fi - else +if ! [ -n "$ARG" ]; then + if ! test -f "$FILE"; then echo "$FILE does not exist! are you sure this is pve?" + exit 0 + fi + + if ! grep -i "$FIND" "$FILE"; then + echo "pve appears to be patched." + exit 0 fi fi + +if ! [ "$ARG" == "--steamroll" ]; then + echo "unrecognized option" + exit 1 +fi + +echo "subscription status: $FIND" +echo "attempting replacement in $FILE..." +apply_razor1911_crack