postinst以当前登录用户身份运行脚本

#!/bin/sh

curuser=`w -h | awk 'NR==1' | awk '{print $1}'`
su - $curuser -c /etc/profile.d/xxxx.sh

 

posted @ 2022-12-22 11:31  ziwuxian  阅读(190)  评论(0编辑  收藏  举报