-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNewPerms.page
54 lines (41 loc) · 1.83 KB
/
NewPerms.page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Menu="Upgrade"
Title="New Permissions"
---
This is a one-time action to be taken after upgrading from a pre-5.0 unRAID server
release to version 5.0. It is also useful for restoring default ownership/permissions on files and
directories when transitioning back from Active Directory to non-Active Directory integration.
This utility starts a background process that goes to each of your data disks and cache disk
and changes file and directory ownership to nobody/users (i.e., uid/gid to 99/100), and sets permissions
as follows:
~~~
For directories:
drwxrwxrwx
For read/write files:
-rw-rw-rw-
For readonly files:
-r--r--r--
~~~
Clicking Start will open another window and start the background process. Closing the window before
completion will terminate the background process - so don't do that. This process can take a long time if you have many files.
<script>
function run_newperms() {
var title="<?=$var[NAME];?> newperms";
var url="/logging.htm?title=" + title + "&cmd=/usr/local/sbin/newperms";
var width =((screen.width*2)/3)||0;
var height =((screen.height*2)/3)||0;
var features ="resizeable=yes,scrollbars=yes,width=" + width + ",height=" + height;
var myWindow=window.open(url, name.replace(/ /g, "_"), features);
myWindow.focus();
}
</script>
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onsubmit="run_newperms()">
<? exec("pgrep newperms", $pids); ?>
<? if (!empty($pids)) : ?>
<input type="submit" value="Start" disabled> Already running!
<? elseif ($var['fsState']!="Started"): ?>
<input type="submit" value="Start" disabled> Array must be Started to change permissions.
<? else: ?>
<input type="submit" name="submit_button" value="Start" disabled>
<input type="checkbox" onClick="submit_button.disabled=!this.checked"><small>Yes I want to do this</small>
<? endif; ?>
</form>