+ if ( $shellmachine ) {
+ if ( $conf->exists('shellmachine-useradd') ) {
+ $useradd = join("\n", $conf->config('shellmachine-useradd') )
+ || 'cp -pr /etc/skel $dir; chown -R $uid.$gid $dir';
+ } else {
+ $useradd = 'useradd -d $dir -m -s $shell -u $uid $username';
+ }
+ if ( $conf->exists('shellmachine-userdel') ) {
+ $userdel = join("\n", $conf->config('shellmachine-userdel') )
+ || 'rm -rf $dir';
+ } else {
+ $userdel = 'userdel $username';
+ }
+ $usermod = join("\n", $conf->config('shellmachine-usermod') )
+ || '[ -d $old_dir ] && mv $old_dir $new_dir || ( '.
+ 'chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; '.
+ 'find . -depth -print | cpio -pdm $new_dir; '.
+ 'chmod u-t $new_dir; chown -R $uid.$gid $new_dir; '.
+ 'rm -rf $old_dir'.
+ ')';
+ }