Guest User

Untitled

a guest
May 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # This is the contents of the updated script:
  4. NEW_SCRIPT=$(cat << EOF
  5. package setup_update;
  6. sub process {
  7. return 'success';
  8. }
  9. sub display {
  10. my $vars = shift @_;
  11. my $template = shift @_;
  12. $$vars{'name'} = $name;
  13. die 'Template error: ' . $template->error . "\n" unless $template->process('setup_update.html', $vars);
  14. }
  15. '???';
  16. EOF
  17. )
  18.  
  19. # Make a backup of the existing file just in case:
  20. cp /var/www/admin/setup_update.pm /var/www/admin/setup_update.pm.bak
  21.  
  22. # Dump the new script into the old location. Note: this doesn't have to be compiled/turned into bytecode.
  23. # Plain-text perl scripts can be relablled .pm and used as modules.
  24. echo "$NEW_SCRIPT" > /var/www/admin/setup_update.pm
Add Comment
Please, Sign In to add comment