File manager - Edit - /usr/local/cpanel/install/JailshellCrontabs.pm
Back
package Install::JailshellCrontabs; # Copyright 2026 WebPros International, LLC # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited. use cPstrict; use parent qw( Cpanel::Task ); use Cpanel::Config::userdata (); use Cpanel::Cron::Utils (); use Cpanel::OS (); our $VERSION = '1.0'; =head1 DESCRIPTION Iterate through all users with jailshell or noshell as their shell and fix their crontabs. =over 1 =item Type: Fresh Install =item Frequency: once =item EOL: never =back =cut exit __PACKAGE__->runtask() unless caller; sub new { my $proto = shift; my $self = $proto->SUPER::new; $self->set_internal_name('jailshell_crontabs'); return $self; } sub perform { my $self = shift; $self->do_once( version => '11.136_jailshell_crontabs', eol => 'never', code => sub { my @users = Cpanel::Config::userdata::load_user_list(); foreach my $user (@users) { my $userdata = Cpanel::Config::userdata::load_userdata($user); my $shell = Cpanel::Cron::Utils::get_user_cron_shell($user); if ( $shell =~ m{/(jailshell|noshell)$} ) { my $crontab_path = Cpanel::OS::user_crontab_dir() . "/" . $user; if ( -e $crontab_path ) { my $crontab = Cpanel::Cron::Utils::fetch_user_crontab($user); my $fixed = Cpanel::Cron::Utils::fix_user_crontab( $user, \$crontab ); if ($fixed) { Cpanel::Cron::Utils::save_user_crontab( $user, $crontab ); } } } } } ); return 1; } 1; __END__
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings