Bob Mottram пре 8 година
родитељ
комит
ec0a88980c
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6
    4
      src/freedombone-app-mediagoblin

+ 6
- 4
src/freedombone-app-mediagoblin Прегледај датотеку

@@ -55,13 +55,15 @@ function mediagoblin_fix_email {
55 55
     # does not have mail access
56 56
     read_config_param 'MEDIAGOBLIN_DOMAIN_NAME'
57 57
     MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
58
-    mgfile=$MEDIAGOBLIN_BASE_DIR/mediagoblin/tools/mail.py
58
+    mgfile=$MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin/tools/mail.py
59
+    if [ ! -f $mgfile ]; then
60
+        echo $'Unable to fix email sending'
61
+        exit 792532
62
+    fi
59 63
     if ! grep 'import os' $mgfile; then
60 64
         sed -i '/import sys/a import os' $mgfile
61 65
     fi
62
-    replacestr='return mhost.sendmail(from_addr, to_addrs, message.as_string())'
63
-    newstr="return os.system(\"echo '\" + message_body + \"' | mail -s '\" + message['Subject'] + \"' \" + message['To'])"
64
-    sed -i "s|${replacestr}|${newstr}|g" $mgfile
66
+    sed -i "s|return mhost.sendmail(from_addr, to_addrs, message.as_string())|return os.system(\"echo '\" + message_body + \"' \| mail -s '\" + message['Subject'] + \"' \" + message['To'])|g" $mgfile
65 67
 }
66 68
 
67 69
 function install_interactive_mediagoblin {