unload_module.sh
来自「bochs : one pc simulator.」· Shell 代码 · 共 35 行
SH
35 行
#! /bin/bash## A simple script to unload the kernel module and remove the old device nodes# for it.## Note:# this must be run as root## Check that root is executing usif [ "$EUID" != "0" ]; then echo "Sorry, you need to be root for this script to work." echo "use 'su -c $0' and enter the root password when prompted" exit -1fi# Check if the module is already loadedif [ "x`grep plex86 /proc/devices`" != "x" ]; then /sbin/rmmod plex86 # Check that it really went (OK - I'm paranoid) if [ "x`grep plex86 /proc/devices`" != "x" ]; then echo "The kernel module failed to unload!" exit -1 fifi# Remove any stale device nodes# (extend for any minor devices created in the future)rm -f /dev/plex86# Job done - Give a little positive feedbackecho "The kernel module is no longer installed."exit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?