浏览代码

Change nextcloud password

Bob Mottram 8 年前
父节点
当前提交
a3025cc142
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      src/freedombone-app-nextcloud

+ 8
- 0
src/freedombone-app-nextcloud 查看文件

@@ -65,6 +65,14 @@ function add_user_nextcloud {
65 65
     echo '0'
66 66
 }
67 67
 
68
+function change_password_nextcloud {
69
+    curr_username="$1"
70
+
71
+    export OC_PASS="$2"
72
+    su -s /bin/sh www-data -c "php occ user:resetpassword --password-from-env $curr_username"
73
+    export OC_PASS=""
74
+}
75
+
68 76
 function install_interactive_nextcloud {
69 77
     if [ ! $ONION_ONLY ]; then
70 78
         ONION_ONLY='no'