0

I am new to ubuntu and I am trying to create a file to fix a suspend problem I have with my system. I have found the answer here as follows:

Put attached script into dir /etc/pm/sleep.d e.g. with name fglrx-fix and make it executable (chmod u+x /etc/pm/sleep.d/fglrx-fix)

#!/bin/bash
#Script kills autofs when going into standby to eliminate issues with it
case $1 in

suspend)
#suspending to RAM
    chvt 1
    echo "Going to sleep"
    sleep 1
;;
resume)
#resume from suspend 
    echo "try to resume"
    sleep 1
    chvt 7
;;       
esac

I just cannot work out how to create the file in terminal, if someone could give a me a step by step instruction that would be great!

albany
  • 73

1 Answers1

2

You'd most commonly use a command line editor like nano. You need to run it as root because of where you're trying to write:

sudo nano /etc/pm/sleep.d/fglrx-fix

nano will open up allowing you to paste the code in. Control+X to exit (press Y to confirm that you want to save it and Return to confirm the filename).

Then (per the original instuctions) make it executable with:

sudo chmod +x /etc/pm/sleep.d/fglrx-fix
Oli
  • 299,380