我有bash脚本" touchpad_settings.sh" :
#!/bin/bash
### BEGIN INIT INFO
# Provides: touchpad_settings.sh
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
ynclient TapButton2=2
synclient TapButton3=3
synclient VertEdgeScroll=1
synclient CircularScrolling=1
我怎么能让它从ubuntu开始,不要写
' sh /touchpad_settings.sh'每次打开笔记本电脑时都在终端?
答案 0 :(得分:0)
创建myscript.conf并使用以下内容保存到/ etc / init:
author "Your name goes here - optional"
description "What your daemon does shortly - optional"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Specify working directory
chdir path_to_your_script
# run your script
exec bash touchpad_settings.sh # or sh touchpad_settings.sh
在该类型命令之后运行您的脚本。
start myscript
您的脚本现在也可以在机器启动时运行。