Navigation Menu

Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Experimental backup and restore original /usr/bin/notify-send
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrehm committed Jun 4, 2013
1 parent 636f5db commit d47b3ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vagrant-notify/action/install_command.rb
Expand Up @@ -27,7 +27,7 @@ def compile_command(env)
def install_command_on_guest(env, command_path)
source = env[:tmp_path].join 'vagrant-notify-send'
env[:machine].communicate.upload(source.to_s, '/tmp/notify-send')
env[:machine].communicate.sudo('mv /tmp/notify-send /usr/bin/notify-send && chmod +x /usr/bin/notify-send')
env[:machine].communicate.sudo('mv /usr/bin/{notify-send,notify-send.bkp}; mv /tmp/notify-send /usr/bin/notify-send && chmod +x /usr/bin/notify-send')
end

##
Expand Down
3 changes: 3 additions & 0 deletions lib/vagrant-notify/action/stop_server.rb
Expand Up @@ -7,6 +7,9 @@ def initialize(app, env)
end

def call(env)
# TODO: Review this
env[:machine].communicate.sudo('rm /usr/bin/notify-send; mv /usr/bin/{notify-send.bkp,notify-send}; exit 0')

@app.call env

pid = env[:notify_data][:pid]
Expand Down

0 comments on commit d47b3ef

Please sign in to comment.