diff --git a/build.sh b/build.sh index b4424cc..81aa241 100755 --- a/build.sh +++ b/build.sh @@ -1,12 +1,14 @@ -oem=$1 #厂商 -cpu=$(arch) #cpu架构 +oem=$1 #厂商 +cpu=$(arch) #cpu架构 sys=$(cat /etc/issue) -sys=${sys%% *} #操作系统 -dpkgpath="" #打包路径 -dpkgarch="" #打包时的版本 -libname="" #动态库名字 -libpath="" #打包时库路径 -time2=$(date "+%g%j") #版本控制 +sys=${sys%% *} #操作系统 +dpkgpath="" #打包路径 +dpkgarch="" #打包时的版本 +libname="" #动态库名字 +libpath="" #打包时库路径 +time2=$(date "+%g%j") #版本控制 +ismount=-1 #是否挂载服务器成功 0成功 非0失败 +FIND_FILE="/home/samba/dpkg" #服务器存放打包路径 不可修改 dpkgtype="app" ver3=10 @@ -25,6 +27,18 @@ if [ "$oem" != "hg" ] && [ "$oem" != "lsc" ] && [ "$oem" != "hw" ] && [ "$oem" ! exit 1 fi +function getismount() +{ + mountpoint -q /home/samba + ismount=$? + if [ $ismount != 0 ];then + echo "$(date):mount is fail!!! and reboot mount" + echo $password|sudo -S mount -t cifs //192.168.100.140/huagao /home/samba/ -o username=huagao,password=hg123123 + else + echo "$(date):mount is succeed" + fi +} + if [ "$cpu" == "x86_64" ]; then dpkgarch="amd64" libpath="x86_64-linux-gnu" @@ -286,3 +300,12 @@ else fi fi dpkg -b backup/$syspath/$oem/$ver backup/dpkg/$mainverstr.$minver/$time2/$dpkgtype/$dpkgpath"_"$ver"_"$dpkgarch.deb + +getismount + +if [ $ismount == 0 ];then + if [ -d "$FIND_FILE/$syspath" ];then + cp -rf backup/dpkg/$mainverstr.$minver $FIND_FILE/$syspath + fi +fi +