Ubuntu免密码输入关机脚本

备注:命令很简单,重点在于不需要输入密码。可以结合自定义桌面图标,一键执行脚本。


#!/bin/bash
PASSWORD=
echo $PASSWORD  | sudo -S shutdown -h $1


man sudo

-S          The -S (stdin) option causes sudo to read the password from
            the standard input instead of the terminal device.  The pass�\
            word must be followed by a newline character.


你可能感兴趣的:(ubuntu,定时关机,免密码)