File tree 3 files changed +18
-14
lines changed
3 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 21
21
*/
22
22
class FtpCommand extends Model
23
23
{
24
- const DEFAULT_CREATE_COMMAND = '. /ftp.sh add --username="{username}" --password="{password}" --directory="{dir}" --user="{user}" ' ;
25
- const DEFAULT_UPDATE_COMMAND = '. /ftp.sh update --username="{username}" --password="{password}" --directory="{dir}" ' ;
26
- const DEFAULT_DELETE_COMMAND = '. /ftp.sh delete --username="{username}" ' ;
24
+ const DEFAULT_CREATE_COMMAND = '{node_tools_path} /ftp.sh add --username="{username}" --password="{password}" --directory="{dir}" --user="{user}" ' ;
25
+ const DEFAULT_UPDATE_COMMAND = '{node_tools_path} /ftp.sh update --username="{username}" --password="{password}" --directory="{dir}" ' ;
26
+ const DEFAULT_DELETE_COMMAND = '{node_tools_path} /ftp.sh delete --username="{username}" ' ;
27
27
28
28
/** @var bool */
29
29
public $ timestamps = false ;
Original file line number Diff line number Diff line change 10
10
*/
11
11
class FtpService
12
12
{
13
- const SCRIPT_NAME = './ftp.sh ' ;
14
- const INSTALL_CMD = './ftp.sh install ' ;
15
- const SCRIPT_DOWNLOAD_LINK = 'https://raw.githubusercontent.com/gameap/scripts/master/ftp/proftpd/ftp.sh ' ;
13
+ const GET_COMMAND = "get-tool https://raw.githubusercontent.com/gameap/scripts/master/ftp/proftpd/ftp.sh " ;
14
+ const INSTALL_COMMAND = '{node_tools_path}/ftp.sh install ' ;
16
15
17
16
/**
18
17
* @param integer $dedicatedServerId
19
18
* @return mixed
20
19
*/
21
20
public function install (int $ dedicatedServerId )
22
21
{
23
- $ executeCommand = 'curl -O ' . self ::SCRIPT_DOWNLOAD_LINK
24
- . ' && ' . 'chmod +x ' . self ::SCRIPT_NAME
25
- . ' && ' . self ::INSTALL_CMD ;
22
+ $ getTask = GdaemonTask::create ([
23
+ 'run_aft_id ' => 0 ,
24
+ 'dedicated_server_id ' => $ dedicatedServerId ,
25
+ 'task ' => GdaemonTask::TASK_CMD_EXEC ,
26
+ 'cmd ' => self ::GET_COMMAND ,
27
+ ]);
26
28
27
- return GdaemonTask::create ([
29
+ $ installTask = GdaemonTask::create ([
28
30
'run_aft_id ' => 0 ,
29
31
'dedicated_server_id ' => $ dedicatedServerId ,
30
32
'task ' => GdaemonTask::TASK_CMD_EXEC ,
31
- 'cmd ' => $ executeCommand ,
32
- ])->id ;
33
+ 'cmd ' => self ::INSTALL_COMMAND ,
34
+ ]);
35
+
36
+ return $ getTask ->id ;
33
37
}
34
- }
38
+ }
Original file line number Diff line number Diff line change 2
2
"name" : " FTP" ,
3
3
"alias" : " ftp" ,
4
4
"description" : " FTP Accounts Management" ,
5
- "version" : " 1.4.0 " ,
5
+ "version" : " 1.4.1 " ,
6
6
"gameap-required" : " >=3.0.0-beta4" ,
7
7
"keywords" : [" ftp" ],
8
8
"active" : 1 ,
You can’t perform that action at this time.
0 commit comments