Tag Info

Hot answers tagged

6

Solution to problem 1 and 2: You need to edit your /etc/sudoers (sudo visudo) file to add the relevant entry to grant the passwordless sudo permission for the user to run this script (not the shutdown command) : foo spamegg = (root) NOPASSWD: /path/to/script.sh Here foo is the username, spamegg is the hostname, replace the /path/to/script.sh ...


4

You can make a conditional to relaunch the script as root if it's launched as a normal user. To shutdown the computer: #!/bin/bash if [[ $USER == "eka" ]]; then # If the script is ran as "eka": sudo $0 # Relaunch it as "root". exit 0 # Once it finishes, exit gracefully. elif [[ $USER != ...


2

When you have two commands on two separate lines of a shell script, the second will only run when the first has finished. To avoid this, you need to add a & to the end of the first command to have it run in the background: #!/bin/bash sudo shutdown -h +30 & gnome-screensaver-command -a As for not asking for the password, you'll need to tell sudo ...


2

This script controls the shutdown timer using sleep and a loop. #!/bin/bash # Read Password read -s -p "Password: " password echo # Send messages for i in {0..5} do echo "Shutdown in" $((30- i * 5)) "minutes" sleep 300 done echo "Shutdown now" | wall # shutdown and screensaver Command echo "$password" | sudo -kS shutdown -h +30 & ...


2

Thanks for all the hints and tips on here. Like other's, I've had issues on my Zenbook UX21E for years, while it was running Windows 7. I never upgraded the OS for years, other than the traditional MS updates. Under windows, the issue was confined to sudden shutdowns while pulling the AC power. (Honestly, I just thought it was a short in the power connector, ...


1

It didn't work for me. Instead of GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=off" I used GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force" and it works. :-)


1

I have upgraded to Gnome 3.16.1 and I am no longer having this problem. I'm guessing it was fixed by this change: ======================================== gtk+ ======================================== Overview of changes in GTK+ 3.16.2 ================================== * Bug fixes: [...] 747689 [...] GtkApplication: Prevent more crashes ...


1

Try disabling hibernation completely by running powercfg /h off as administrator in windows. Happy that this solved the issue for you!


1

1.Try to reinstall NotifyOSD sudo apt-get --reinstall install libnotify-bin notify-osd Then restart. 2.Installing Battstat Applet gives you a warning on top of all windows like this:- http://techrax.tk/wp-content/uploads/2015/05/critical_message.png To install it, do:- add-apt-repository ppa:iaz/battery-status apt-get update apt-get install ...


1

You are using the wrong commands, Try one of below:- sudo shutdown -h now sudo poweroff sudo halt -p sudo init 0 sudo shutdown -p now For forced poweroff (not shutdown):- sudo poweroff -f


1

Instead, you could use at command. Install it with sudo apt-get install at And run sudo echo "shutdown -h now"|at now + 30 min



Only top voted, non community-wiki answers of a minimum length are eligible