-
Notifications
You must be signed in to change notification settings - Fork 4
/
execfs.php
74 lines (63 loc) · 1.86 KB
/
execfs.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
# gpl2
# by crutchy
/*
exec:~get|20|0|0|1|@|||0|php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~set|20|0|0|1|@|||0|php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~cp|20|0|0|1|@|||0|php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~mv|20|0|0|1|@|||0|php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~rm|20|0|0|1|@|||0|php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~ls|20|0|0|1|@|||0|php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~cd|20|0|0|1|@|||0|php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
*/
#####################################################################################################
ini_set("display_errors","on");
require_once("lib.php");
require_once("execfs_lib.php");
$trailing=trim($argv[1]);
$nick=strtolower(trim($argv[2]));
$dest=strtolower(trim($argv[3]));
$alias=strtolower(trim($argv[4]));
$fs=get_fs();
switch ($alias)
{
case "~get":
# ~get [%path%]%name%
execfs_get($nick,$trailing);
break;
case "~set":
# ~set [%path%]%name% = %value%
$parts=explode("=",$trailing);
if (count($parts)>=2)
{
$name=trim($parts[0]);
array_shift($parts);
$value=trim(implode("=",$parts));
if ($name<>"")
{
execfs_set($nick,$name,$value);
break;
}
}
privmsg("syntax: ~set [%path%]%name% = %value%");
break;
case "~cp":
# ~cp [%from_path%]%from_name% > %to_path%[%to_name%]
break;
case "~mv":
# ~mv [%from_path%]%from_name% > %to_path%[%to_name%]
break;
case "~rm":
# ~rm [%path%]%name%
break;
case "~ls":
# ~ls %path%
execfs_ls();
break;
case "~cd":
# ~cd %path%
break;
}
set_fs();
#####################################################################################################
?>