File manager - Edit - /usr/local/cpanel/bin/unregister_appconfig
Back
#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - bin/unregister_appconfig Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited package scripts::unregister_appconfig; use strict; use Cpanel::AppConfig (); use Cpanel::AppConfig::Register (); use Cpanel::LoadFile (); run() unless caller; sub run { my $app_config_register_obj = Cpanel::AppConfig::Register->new(); my $conf = $ARGV[0]; if ( !length $conf ) { print "The 'conf_file|appname' argument is required.\n"; usage(); } usage() if $conf =~ m/^-*help/; my $conf_text; if ( -r $conf ) { if ( !-f _ ) { print "The 'conf_file' must be readable and a plain file.\n"; usage(); } $conf_text = Cpanel::LoadFile::loadfile($conf); if ( !length $conf_text ) { print "The 'conf_file' must be a valid appconfig conf file.\n"; usage(); } # For loading v1.0 appconfig files if ( $conf_text !~ m/^[ \t]*name=/mi ) { $conf_text .= "\nname=" . Cpanel::AppConfig::determine_name_from_filename($conf) . "\n"; } } elsif ( $conf =~ m/^[a-zA-Z0-9_-]+$/ ) { $conf_text = "name=$conf\n"; } else { print "The first argument does not reference a appconfig file or an installed app by name.\n"; usage(); } my ( $status, $statusmsg ) = $app_config_register_obj->unregister( $conf_text, $conf ); print $statusmsg . "\n"; usage() if !$status; exit(0); } sub usage { print <<EOM; $0: Summary This tool allows you to unregister an appconfig app and ensures it it is no longer available for use. For more information please see the documentation for this system: https://go.cpanel.net/appconfig Example usage: $0 <conf_file|appname> $0 ./pkg/appconfig/myapp.appconfig $0 myapp $0 --help EOM exit(1); }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings