Skip to content

Commit

Permalink
Merge pull request #17 from AhmedKamal1432/amahi-8
Browse files Browse the repository at this point in the history
fstab: change the exclamation mark to  pipline
  • Loading branch information
cpg committed Sep 27, 2015
2 parents ce4417f + 8b437c6 commit ea7f3ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/fstab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ def add_entry(opts = {})
backup_fstab
#TODO: Append format_entry(dev, opts) to "/etc/fstab" by using "Command" library not using File.open
command = "echo"
params = " #{@contents} ! sudo tee /etc/fstab"
params = " #{@contents} | sudo tee /etc/fstab"
echo = CommandExecutor.new command, params
echo.execute
raise "Command execution error: #{echo.stderr}" if not echo.success?
command = "echo"
params = " #{format_entry(dev, opts)} ! sudo tee -a /etc/fstab"
params = " #{format_entry(dev, opts)} | sudo tee -a /etc/fstab"
echo = CommandExecutor.new command, params
echo.execute
raise "Command execution error: #{echo.stderr}" if not echo.success?
Expand Down Expand Up @@ -318,7 +318,7 @@ def backup_fstab
return unless @backup
#sh -c "echo 'something' >> /etc/privilegedfile"
command = "echo"
params = " #{@contents} ! sudo tee #{@backup_dir}/fstab.#{Time.now.to_f}.bak"
params = " #{@contents} | sudo tee #{@backup_dir}/fstab.#{Time.now.to_f}.bak"

echo = CommandExecutor.new command, params
echo.execute
Expand Down

0 comments on commit ea7f3ca

Please sign in to comment.