脚本最后使用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

shell脚本自我销毁(运行完后自我删除)
文章版权及转载声明:
作者:念宗本文地址:http://pyops.net/?id=10发布于 7年前 ( 2018-11-19 )
文章转载或复制请以超链接形式并注明出处运维之道
觉得文章有用就打赏一下文章作者
支付宝扫一扫打赏

微信扫一扫打赏

还没有评论,来说两句吧...