脚本最后使用rm $0 或者unlink $0
例子
#!/bin/bash
#
# network Bring up/down networking
#
# chkconfig: 35 10 90
# description: Activates/Deactivates all network interfaces configured to \
# start at boot time.
#
### BEGIN INIT INFO
# Provides: $network
### END INIT INFO
# Source function library.
. /etc/init.d/functions
echo "rm self"
unlink $0
阅读(5683) | 评论(0) | 转发(0) |