Skip to content

Commit

Permalink
Merge pull request #10 from riffy/feature/post_uninstall
Browse files Browse the repository at this point in the history
chore: Action: Release action to set correct chmod +x
  • Loading branch information
riffy authored Feb 2, 2024
2 parents 6f494df + 48b0b71 commit 9055a8b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
run: |
rm -rf ./paldmin/docs && rm -rf ./paldmin/.git && rm -rf ./paldmin/.github
- name: Apply CHMOD to PL and CGI files
run: |
find ./paldmin -type f \( -name "*.pl" -o -name "*.cgi" \) -exec chmod +x {} \;
- name: Create Artifact
run: |
tar -zcvf "paldmin-${{ github.event.inputs.release_version }}.tar.gz" ./paldmin
Expand Down
32 changes: 32 additions & 0 deletions uninstall.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/perl
# uninstall.pl
# Performs uninstall stuff

require 'paldmin-lib.pl';

=head1 Uninstall
=cut

=head2 module_uninstall ()
Performs a cleanup:
1. Removes possible cronjob
2. Deletes the config file
=cut
sub module_uninstall {
# Check if CRON needs to be deleted
my $cron = foreign_installed("cron");
if ($cron) {
my $cmd = "$module_config_directory/cron_restart.pl";
@jobs = cron::list_cron_jobs();
($job) = grep { $_->{'command'} eq $cmd } @jobs;
if ($job) {
cron::delete_cron_job($job);
}
}

# Delete config file
if (-r "$config{'paldmin_config'}") {
unlink_file($config{'paldmin_config'});
}
}

0 comments on commit 9055a8b

Please sign in to comment.