postinst

来自「这是国外的resip协议栈」· 代码 · 共 50 行

TXT
50
字号
#!/bin/bashset -eadd_user_if_missing() {	if [ -x /usr/sbin/adduser ]; then        	if ! id -u repro > /dev/null 2>&1; then			adduser --system --group --home /var/lib/repro \				--no-create-home --disabled-password \				--shell /bin/false \		                repro		fi	fi	if [ ! -e /var/lib/repro ]; then			mkdir /var/lib/repro			chown repro:repro /var/lib/repro	fi}link_down_docs() {	if [ -d /usr/doc -a ! -e /usr/doc/repro -a -d /usr/share/doc/repro ]	then		ln -sf ../share/doc/repro /usr/doc/repro	fi}case "$1" in	configure)		add_user_if_missing		#link_down_docs		;;	abort-upgrade|abort-remove|abort-deconfigure)		;;	*)		echo "postinst called with unknown argument \'$1\'" >&2		exit 1		;;esacif [ -x "/etc/init.d/repro" ]; then	update-rc.d repro defaults 23 > /dev/null	if ! invoke-rc.d repro restart ; then		echo ""		echo "Repro failed to (re)start."	fifiexit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?