|
|
|
|
55
|
|
55
|
|
56
|
${PROJECT_NAME}-pass -u $remove_username --rmapp radicale
|
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
|
sed -i "/${remove_username}:/d" ${RADICALE_USERS}
|
59
|
sed -i "/${remove_username}:/d" ${RADICALE_USERS}
|
60
|
if [ -d /var/www/radicale/collections/${remove_username} ]; then
|
60
|
if [ -d /var/www/radicale/collections/${remove_username} ]; then
|
61
|
rm -rf /var/www/radicale/collections/${remove_username}
|
61
|
rm -rf /var/www/radicale/collections/${remove_username}
|
|
|
|
|
77
|
touch ${RADICALE_USERS}
|
77
|
touch ${RADICALE_USERS}
|
78
|
fi
|
78
|
fi
|
79
|
|
79
|
|
80
|
- if ! grep "$new_username:" ${RADICALE_USERS}; then
|
|
|
|
|
80
|
+ if ! grep -q "$new_username:" ${RADICALE_USERS}; then
|
81
|
htpasswd -bd ${RADICALE_USERS} "$new_username" "$new_user_password"
|
81
|
htpasswd -bd ${RADICALE_USERS} "$new_username" "$new_user_password"
|
82
|
|
82
|
|
83
|
echo '{"ICAL:calendar-color": "#9e50df"}' > /var/www/radicale/collections/${new_username}.props
|
83
|
echo '{"ICAL:calendar-color": "#9e50df"}' > /var/www/radicale/collections/${new_username}.props
|
|
|
|
|
101
|
|
101
|
|
102
|
${PROJECT_NAME}-pass -u $existing_username -a radicale -p "$new_user_password"
|
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
|
sed -i "/${existing_username}:/d" ${RADICALE_USERS}
|
105
|
sed -i "/${existing_username}:/d" ${RADICALE_USERS}
|
106
|
htpasswd -bd ${RADICALE_USERS} "$existing_username" "$new_user_password"
|
106
|
htpasswd -bd ${RADICALE_USERS} "$existing_username" "$new_user_password"
|
107
|
systemctl reload radicale
|
107
|
systemctl reload radicale
|
|
|
|
|
513
|
set_completion_param "radicale onion domain" "${RADICALE_ONION_HOSTNAME}"
|
513
|
set_completion_param "radicale onion domain" "${RADICALE_ONION_HOSTNAME}"
|
514
|
else
|
514
|
else
|
515
|
# alter the existing site config
|
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
|
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}
|
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
|
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}
|
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
|
fi
|
519
|
fi
|