mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Include default installation scripts, as well as ability to symlink a script
This commit is contained in:
@@ -63,6 +63,39 @@ class ServiceOption extends Model
|
||||
return (is_null($this->startup)) ? $this->service->startup : $this->startup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the install script for the option; if option is copying from another
|
||||
* it will return the copied script.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCopyScriptInstallAttribute($value)
|
||||
{
|
||||
return (is_null($this->copy_script_from)) ? $this->script_install : $this->copyFrom->script_install;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the entry command for the option; if option is copying from another
|
||||
* it will return the copied entry command.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCopyScriptEntryAttribute($value)
|
||||
{
|
||||
return (is_null($this->copy_script_from)) ? $this->script_entry : $this->copyFrom->script_entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the install container for the option; if option is copying from another
|
||||
* it will return the copied install container.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCopyScriptContainerAttribute($value)
|
||||
{
|
||||
return (is_null($this->copy_script_from)) ? $this->script_container : $this->copyFrom->script_container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets service associated with a service option.
|
||||
*
|
||||
@@ -102,4 +135,9 @@ class ServiceOption extends Model
|
||||
{
|
||||
return $this->hasMany(Pack::class, 'option_id');
|
||||
}
|
||||
|
||||
public function copyFrom()
|
||||
{
|
||||
return $this->belongsTo(ServiceOption::class, 'copy_script_from');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user