Quellcode durchsuchen

Use == instead of = for string comparisons

In if-statements, I think string comparisons only work, if the operator == is used.
pull/33/head
Sailing74 vor 7 Jahren
committed by GitHub
Ursprung
Commit
c3baef4a06
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: 4AEE18F83AFDEB23
1 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. +5
    -5
      log2ram

+ 5
- 5
log2ram Datei anzeigen

@@ -16,7 +16,7 @@ isSafe () {
syncToDisk () {
isSafe

if [ "$USE_RSYNC" = true ]; then
if [ "$USE_RSYNC" == true ]; then
rsync -aXWv --delete --exclude log2ram.log --links $RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
else
cp -rfup $RAM_LOG/ -T $HDD_LOG/ 2>&1 | $LOG_OUTPUT
@@ -30,13 +30,13 @@ syncFromDisk () {
echo "ERROR: RAM disk too small. Can't sync."
umount -l $RAM_LOG/
umount -l $HDD_LOG/
if [ "$MAIL" = true ]; then
echo "LOG2RAM : No place on RAM anymore, fallback on the disk" | mail -s 'Log2Ram Error' root;
fi
if [ "$MAIL" == true ]; then
echo "LOG2RAM : No place on RAM anymore, fallback on the disk" | mail -s 'Log2Ram Error' root;
fi
exit 1
fi

if [ "$USE_RSYNC" = true ]; then
if [ "$USE_RSYNC" == true ]; then
rsync -aXWv --delete --exclude log2ram.log --links $HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
else
cp -rfup $HDD_LOG/ -T $RAM_LOG/ 2>&1 | $LOG_OUTPUT


Laden…
Abbrechen
Speichern