Bob Mottram 8 vuotta sitten
vanhempi
commit
bef67090a9
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4
    4
      src/freedombone-app-radicale

+ 4
- 4
src/freedombone-app-radicale Näytä tiedosto

@@ -55,7 +55,7 @@ function remove_user_radicale {
55 55
 
56 56
     ${PROJECT_NAME}-pass -u $remove_username --rmapp radicale
57 57
 
58
-    if grep "${remove_username}:" ${RADICALE_USERS}; then
58
+    if grep -q "${remove_username}:" ${RADICALE_USERS}; then
59 59
         sed -i "/${remove_username}:/d" ${RADICALE_USERS}
60 60
         if [ -d /var/www/radicale/collections/${remove_username} ]; then
61 61
             rm -rf /var/www/radicale/collections/${remove_username}
@@ -77,7 +77,7 @@ function add_user_radicale {
77 77
         touch ${RADICALE_USERS}
78 78
     fi
79 79
 
80
-    if ! grep "$new_username:" ${RADICALE_USERS}; then
80
+    if ! grep -q "$new_username:" ${RADICALE_USERS}; then
81 81
         htpasswd -bd ${RADICALE_USERS} "$new_username" "$new_user_password"
82 82
 
83 83
         echo '{"ICAL:calendar-color": "#9e50df"}' > /var/www/radicale/collections/${new_username}.props
@@ -101,7 +101,7 @@ function change_password_radicale {
101 101
 
102 102
     ${PROJECT_NAME}-pass -u $existing_username -a radicale -p "$new_user_password"
103 103
 
104
-    if grep "${existing_username}:" ${RADICALE_USERS}; then
104
+    if grep -q "${existing_username}:" ${RADICALE_USERS}; then
105 105
         sed -i "/${existing_username}:/d" ${RADICALE_USERS}
106 106
         htpasswd -bd ${RADICALE_USERS} "$existing_username" "$new_user_password"
107 107
         systemctl reload radicale
@@ -513,7 +513,7 @@ function install_radicale {
513 513
         set_completion_param "radicale onion domain" "${RADICALE_ONION_HOSTNAME}"
514 514
     else
515 515
         # alter the existing site config
516
-        if ! grep "# Start radicale" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
516
+        if ! grep -q "# Start radicale" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}; then
517 517
             sed -i '/ 443/a    # Start radicale\n  location @radicale {\n    auth_basic "Radicale";\n    auth_basic_user_file /var/www/radicale/users;\n    proxy_pass http://localhost:52322;\n    proxy_buffering off;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n  }\n\n  location /radicale {\n      try_files $uri @radicale;\n  }\n\n  location /.well-known/carddav {\n      try_files $uri @radicale;\n  }\n\n  location /.well-known/caldav {\n      try_files $uri @radicale;\n  }\n    # End radicale' /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
518 518
             sed -i '/listen localhost/a    # Start radicale\n  location @radicale {\n    auth_basic "Radicale";\n    auth_basic_user_file /var/www/radicale/users;\n    proxy_pass http://localhost:52322;\n    proxy_buffering off;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n  }\n\n  location /radicale {\n      try_files $uri @radicale;\n  }\n\n  location /.well-known/carddav {\n      try_files $uri @radicale;\n  }\n\n  location /.well-known/caldav {\n      try_files $uri @radicale;\n  }\n    # End radicale' /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
519 519
         fi