Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/extensions/notifications/channels/pushover.rb
1154 views
1
require 'rushover'
2
3
module BeEF
4
module Extension
5
module Notifications
6
module Channels
7
class Pushover
8
def initialize(message)
9
@config = BeEF::Core::Configuration.instance
10
11
# Configure the Pushover Client
12
client = Rushover::Client.new(@config.get('beef.extension.notifications.pushover.app_key'))
13
14
res = client.notify(@config.get('beef.extension.notifications.pushover.user_key'), message)
15
print_error '[Notifications] Pushover notification failed' unless res.ok?
16
rescue StandardError => e
17
print_error "[Notifications] Pushover notification initialization failed: '#{e.message}'"
18
end
19
end
20
end
21
end
22
end
23
end
24
25