backup go script with random extension

Revert "backup go script with random extension"

This reverts commit f3498bd869e998040685399a2cb198e57809653f.

change backup extension
This commit is contained in:
ljm42
2024-04-12 13:06:59 -07:00
parent 80b200950f
commit 8f99ba2346

View File

@@ -193,13 +193,13 @@ fi
# add new line with call to emhttp (preserve any params to emhttp and CRLF line endings)
GOTEST1='^[^#]*/usr/local/sbin/emhttp(.*)&(.*)$'
if grep -q -E "$GOTEST1" $CONFIG/go; then
cp $CONFIG/go $CONFIG/go-
cp $CONFIG/go $CONFIG/go~
sed -i -E "s@$GOTEST1@/usr/local/sbin/emhttp\1\2@g" $CONFIG/go
fi
# delete lines added by ProxyEditor
GOTEST2='# Added by ProxyEditor'
if grep -q "$GOTEST2" $CONFIG/go; then
[[ ! -f $CONFIG/go- ]] && cp $CONFIG/go $CONFIG/go-
[[ ! -f $CONFIG/go~ ]] && cp $CONFIG/go $CONFIG/go~
sed -i "/$GOTEST2/d" $CONFIG/go
fi