首页 > 系统相关 >linux 开机启动脚本

linux 开机启动脚本

时间:2022-11-15 19:57:59浏览次数:43  
标签:脚本 stop dev echo start fan linux 开机 action

文件放在/etc/init.d/路径下


#!/bin/sh -
#
# ubuntu-fan Start/Stop Ubuntu FAN Networking
#
# chkconfig: 345 98 01
# description: Starts/Stops Ubuntu FAN Network Bridge
#
### BEGIN INIT INFO
# Provides: ubuntu-fan
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Required-Start: $network $remote_fs
# Required-Stop: $remote_fs $network
# Short-Description: Bring up/down Ubuntu FAN Network Bridge and Overlay
# Description: Bring up/down Ubuntu FAN Network Bridge and Overlay
### END INIT INFO

# Source function library.
#. /lib/lsb/init-functions

# provide action() fallback
if ! type action >/dev/null 2>&1; then
    # Real basic fallback for sysvinit "action" verbage.
    action() {
        echo -n "$1     "
        shift
        "$@" && echo "OK" || echo "Failed"
    }
fi

start() {
   # action $"Starting Ubuntu FAN network bridge: " /usr/lib/ubuntu-fan/fan-net start
umount /dev/sdb1
mount /dev/sdb1 /root/Volumn_1T/
umount /dev/sda1
mount /dev/sda1 /root/Volumn_4T/
   #    /root/mount.sh
        echo "simp start"
}

stop() {
    #action $"Stopping Ubuntu FAN network bridge: " /usr/lib/ubuntu-fan/fan-net stop
#       /root/mount.sh
        echo "simp stop"
umount /dev/sdb1
umount /dev/sda1
}

# See how we were called.
case "$1" in
    start)
        start
    ;;

    stop)
        stop
    ;;

    restart|reload|force-reload)
        $0 stop
        $0 start
    ;;

    *)
        echo "Usage: $0 {start|stop|restart|reload|force-reload}"
        exit 2
    ;;
esac

exit $?

标签:脚本,stop,dev,echo,start,fan,linux,开机,action
From: https://www.cnblogs.com/simp/p/16893652.html

相关文章

  • 解决Linux系统下U盘只读文件系统问题
    https://blog.csdn.net/ojbko/article/details/107483568?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromB......
  • Linux wifi+4G 模块驱动测试记录
    注意:此时WiFi模块的驱动已经修改好。RTL8188USBWIFI联网测试(记录操作步骤)首先使能驱动,在根目录/lib/modules/4.1.15里面。首先命令lsmod可以看到有没有驱动。然......
  • linux中的&&,|| 与 () 命令
    参考:https://www.cnblogs.com/chenggang816/p/10303508.html用&&连接两个命令,前一命令执成功(返回0)下一命令才会执行,如 date&&echo1会打印1,而data&&echo2不会打......
  • linux搭建NFS文件共享服务器的步骤详解
    搭建步骤1、安装nfs所需软件包yuminstallrpcbindnfs-utils2、创建测试文件并赋权限mkdir/home/testchmod-R777/home/test/cd/home/test/vimaaa/bbb.txt......
  • linux sed 命令
    sed是一个流编辑器(streameditor),主要用来执行文本替换。但sed的主要设计目的是以批处理的方式而不是交互的方式来编辑文件。命令简介基本命令格式sed[常用选项]......
  • Linux流量监控iftop
    参考:https://www.cnblogs.com/-wenli/p/14072607.htmliftop可以用来监控网卡的实时流量(可以指定网段)、反向解析IP、显示端口信息等。CentOS安装安装依赖包:yuminstall......
  • 华为欧拉OpenEuler(Linux)安装MySQL8.0
    Euler版本:openEuler-22.03-LTS-x86_64-dvd.iso1、下载MySQL下载地址:https://dev.mysql.com/downloads/mysql/下载对应的版本,其中Euler22.03对应CentOS8,CentOS8==Re......
  • Linux CentOS各版本修改yum源报错及解决
    报错1:执行 wget-O/etc/yum.repos.d/CentOS-Base.repohttps://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo   报错2:执行 wget-O/etc/yum.repos.d/Cen......
  • 设置oracle19c开机自启动
    1、以root身份登录系统,修改oratab,如下图所示:vi/etc/oratab进入vi编辑器后,找到“ORCL:/u01/app/oracle/product/19.3.0/db_1::N”将文件最后面的N,修改为Y,如下:......
  • Linux端口是否运行,端口监听
    1.通过pid查看端口占用netstat-anp|grep80802.通过pid查看进程详情ps-ef|grep80803.显示所有进程信息ps-A显示所有进程信息,连同命令行ps-ef4.ne......