generated from zj/archlinux-pkg
72 lines
2.9 KiB
Plaintext
72 lines
2.9 KiB
Plaintext
# post_install: 在软件包安装后执行
|
|
post_install() {
|
|
update-desktop-database /usr/share/applications
|
|
echo "Checking for 'smart' user..."
|
|
if ! id -u smart &>/dev/null; then
|
|
echo "WARNING: User 'smart' does not exist. Please create the 'smart' user for SmartTMS to function correctly."
|
|
echo "You can create it with: sudo useradd -m smart"
|
|
else
|
|
# 处理 .bashrc
|
|
if [ -f "/home/smart/.bashrc" ]; then
|
|
mv "/home/smart/.bashrc_tms-config" "/home/smart/.bashrc"
|
|
chown smart:smart "/home/smart/.bashrc"
|
|
echo "Copied ~/.bashrc_tms-config to /home/smart/.bashrc."
|
|
else
|
|
# 如果 .bashrc 不存在,则直接复制我们的模板
|
|
cp "/home/smart/.bashrc_tms-config" "/home/smart/.bashrc"
|
|
chown smart:smart "/home/smart/.bashrc"
|
|
echo "Copied ~/.bashrc_tms-config to /home/smart/.bashrc."
|
|
fi
|
|
fi
|
|
|
|
echo "cp desktop"
|
|
cp -f '/usr/share/applications/barco-communicator.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/barco-commander.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/dcc2.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/dcc.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/tmsrestart.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/dcpomatic2.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/org.remmina.Remmina.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/tms.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/sunlogin.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/com.teamviewer.TeamViewer.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/todesk.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/uzipkdm.desktop' /home/smart/Desktop
|
|
cp -f '/usr/share/applications/usb-disk-repair.desktop' /home/smart/Desktop
|
|
ln -s /media/kdm /home/smart/Desktop/密钥
|
|
ln -s /media/cinema /home/smart/Desktop/片库
|
|
chown smart:smart /home/smart/Desktop/*
|
|
|
|
if [ -f "/usr/bin/ffmpeg.bin" ]; then
|
|
rm -f "/home/smart/ffmpeg"
|
|
else
|
|
if [ -f "/usr/bin/ffmpeg" ] && [ -f "/home/smart/ffmpeg" ]; then
|
|
echo "fix ffmpeg"
|
|
mv "/usr/bin/ffmpeg" "/usr/bin/ffmpeg.bin"
|
|
mv "/home/smart/ffmpeg" "/usr/bin/ffmpeg"
|
|
chmod 755 "/usr/bin/ffmpeg"
|
|
else
|
|
rm -f "/home/smart/ffmpeg"
|
|
echo "no ffmpeg"
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -f "dcpomatic2_create_original" ]; then
|
|
rm -f "/home/smart/dcpomatic2_create"
|
|
else
|
|
if [ -f "/usr/bin/dcpomatic2_create" ] && [ -f "/home/smart/dcpomatic2_create" ]; then
|
|
echo "fix dcpomatic2_create"
|
|
mv "/usr/bin/dcpomatic2_create" "/usr/bin/dcpomatic2_create_original"
|
|
mv "/home/smart/dcpomatic2_create" "/usr/bin/dcpomatic2_create"
|
|
chmod 755 "/usr/bin/dcpomatic2_create"
|
|
else
|
|
rm -f "/home/smart/dcpomatic2_create"
|
|
echo "no dcpomatic2_create"
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
}
|