Ubuntu 创建开机启动脚本的一种方法(rc.local)
来源:互联网 发布:mahout实战源码数据集 编辑:程序博客网 时间:2024/06/16 16:39
#
1、编辑/etc/rc.local
如:sudo vim /etc/rc.local
在 exit 0之前添加脚本代码
如:sh /ect/ifconfig.sh
rc.local:
1 #!/bin/sh -e
2 #
3 # rc.local
4 #
5 # This script is executed at the end of each multiuser runlevel.
6 # Make sure that the script will "exit 0" on success or any other
7 # value on error.
8 #
9 # In order to enable or disable this script just change the execution
10 # bits.
11 #
12 # By default this script does nothing.
13
14 sh /etc/ifconfig.sh
15
16 exit 0
2.在/etc/目录下创建脚本文件(必须在该目录下,其他目录没成功,不知道为什么,希望看见的大神解答下,谢谢)
如:sudo vim ifconfig.sh
1
2 cd /home/sunny/test/ && \
3 ifconfig > README && \
4 git add README && \
5 git commit -m "test2" && \
6 git push -u origin master
1、编辑/etc/rc.local
如:sudo vim /etc/rc.local
在 exit 0之前添加脚本代码
如:sh /ect/ifconfig.sh
rc.local:
1 #!/bin/sh -e
2 #
3 # rc.local
4 #
5 # This script is executed at the end of each multiuser runlevel.
6 # Make sure that the script will "exit 0" on success or any other
7 # value on error.
8 #
9 # In order to enable or disable this script just change the execution
10 # bits.
11 #
12 # By default this script does nothing.
13
14 sh /etc/ifconfig.sh
15
16 exit 0
2.在/etc/目录下创建脚本文件(必须在该目录下,其他目录没成功,不知道为什么,希望看见的大神解答下,谢谢)
如:sudo vim ifconfig.sh
1
2 cd /home/sunny/test/ && \
3 ifconfig > README && \
4 git add README && \
5 git commit -m "test2" && \
6 git push -u origin master
0 0
- Ubuntu 创建开机启动脚本的一种方法(rc.local)
- Update-rc.d && rc.local管理Ubuntu的开机启动
- ubuntu开机启动rc.local无效
- 树莓派开机自启的方法(解决rc.local开机步启动问题)
- 开机启动服务chkconfig开机启动脚本/etc/rc.local
- Ubuntu 创建开机自启动脚本的方法
- Ubuntu 创建开机自启动脚本的方法
- Ubuntu 创建开机自启动脚本的方法
- Ubuntu python 创建开机自启动脚本的方法
- Ubuntu 创建开机自启动脚本的方法
- Ubuntu 创建开机自启动脚本的方法
- Ubuntu 创建开机自启动脚本的方法
- Ubuntu 创建开机自启动脚本的方法
- Ubuntu 创建开机自启动脚本的方法
- 树莓派的rc.local文件(设置开机启动)
- (OK) Fedora 24 开机自动启动脚本 - rc.local - rc-local.service
- linux的开机启动过程(rc.local、init.d、rc.x、init的作用)
- 在ubuntu启动时执行脚本 - rc.local
- [CrackCode] 5.5 Determine the number of bits required to convert integer A to integer B
- 第十周任务四完数
- todo list ~~ this is a greet problem
- C++输出格式控制
- [leet code] Longest Consecutive Sequence
- Ubuntu 创建开机启动脚本的一种方法(rc.local)
- 百度、腾讯、人人网,他们如何知道你平时访问了哪些网站
- 让“结对编程”跨越地域的障碍
- USACO The Clocks 一种O(1)的算法
- 查看服务器外网ip
- SQL Server SQL语句导入导出大全
- 为兴趣而生
- windows7,单电脑不用虚拟机实现MySQL集群
- 观察、保护、重构:驯服Trivia烂代码心得