删除老版本的安装脚本及安装包

This commit is contained in:
栽培者 2018-03-12 20:28:03 +08:00
parent b26b9c2908
commit d9c0bcdf32
6 changed files with 0 additions and 228 deletions

View File

@ -1,65 +0,0 @@
#! /bin/sh
rootFolder=""
webFolder=""
shareFolder="/usr/local/share"
orgindex="index.original.html"
index="index.html"
tmpFolder="/tmp/tr-web-control/"
packname="transmission-control-full.tar.gz"
oldpackname="transmission-web-control.tar.gz"
host="https://github.com/hitechbeijing/transmission-web-control/raw/master/release/"
downloadurl="$host$oldpackname"
downloadurlfull="$host$packname"
if [ ! -d "$tmpFolder" ]; then
cd /tmp
mkdir tr-web-control
fi
cd "$tmpFolder"
# 判断DownloadStation安装目录是否存在
folderIsExist=0
echo "Finding DownloadStation install target: ""$rootFolder""..."
# 感谢 yumin9822 提供的代码
rootFolder="/var/packages/DownloadStation/target"
if [ -d "$rootFolder" ]; then
webFolder="$rootFolder""web/"
folderIsExist=1
fi
# 如果目录存在,则进行下载和更新动作
if [ $folderIsExist = 1 ]; then
echo "Downloading and Installing Transmission Web Control..."
wget "$downloadurl"
tar -xzf "$oldpackname"
mv "$tmpFolder/web/$index" "$tmpFolder/web/$orgindex"
rm "$oldpackname"
wget "$downloadurlfull"
tar -xzf "$packname"
rm "$packname"
# 复制文件到
cp -r "$tmpFolder/web" "$rootFolder"
# 改权限
cd "$rootFolder"
chown DownloadStation:DownloadStation web
cd "$rootFolder/web"
chown -R DownloadStation:DownloadStation *
chown DownloadStation:DownloadStation *
# 建软链接
if [ ! -d "$shareFolder" ]; then
cd /usr/local
mkdir share
fi
cd "$shareFolder"
mkdir transmission
ln -s "$rootFolder/web" "$shareFolder/transmission/web"
echo "Done."
else
echo "#######################################################"
echo "#"
echo "# ERROR : DownloadStation install target is missing."
echo "#"
echo "#######################################################"
fi
rm -rf "$tmpFolder"

View File

@ -1,49 +0,0 @@
#! /bin/sh
rootFolder=""
webFolder=""
orgindex="index.original.html"
index="index.html"
tmpFolder="/tmp/tr-web-control/"
packname="transmission-control-full.tar.gz"
host="https://github.com/ronggang/transmission-web-control/raw/master/release/"
donwloadurl="$host$packname"
if [ ! -d "$tmpFolder" ]; then
cd /tmp
mkdir tr-web-control
fi
cd "$tmpFolder"
# find web ui folder
folderIsExist=0
echo "Searching Transmission Web Folder..."
# thanks yumin9822 for this piece of code
rootFolder=`find / -name 'web' -type d | grep 'transmission/web' | head -n 1 | sed 's/web.*$//g'`
echo "Folder: ""$rootFolder""..."
if [ -d "$rootFolder""web/" ]; then
webFolder="$rootFolder""web/"
folderIsExist=1
fi
# if the folder does not existthen do download and installation
if [ $folderIsExist = 1 ]; then
echo "Transmission Web Control Is Downloading..."
wget "$donwloadurl" --no-check-certificate
echo "Installing..."
tar -xzf "$packname"
rm "$packname"
# if did not install beforethen change the original system file name
if [ ! -f "$webFolder$orgindex" -a -f "$webFolder$index" ]; then
mv "$webFolder$index" "$webFolder$orgindex"
fi
# copy the files to folder
cp -r web "$rootFolder"
echo "Done."
else
echo "##############################################"
echo "#"
echo "# ERROR : Transmisson WEB UI Folder is missing."
echo "#"
echo "##############################################"
fi
rm -rf "$tmpFolder"

View File

@ -1,57 +0,0 @@
#!/bin/sh
rootFolder=""
webFolder=""
orgindex="index.original.html"
index="index.html"
tmpFolder="/tmp/tr-web-control"
packname="transmission-control-full.tar.gz"
host="https://github.com/ronggang/transmission-web-control/raw/master/release/"
downloadurl="$host$packname"
if [ ! -d "$tmpFolder" ]; then
mkdir -p "$tmpFolder"
fi
# find web ui folder
folderIsExist=0
echo "Searching Transmission Web Folder..."
rootFolder="/usr/share/transmission"
echo "Looking for folder: $rootFolder/web"
if [ -d "$rootFolder/web" ]; then
webFolder="$rootFolder/web"
folderIsExist=1
echo "Folder found. Using it."
else
echo "Folder not found. Will search the entire /. This will take a while..."
rootFolder=`find / -name 'web' -type d 2>/dev/null| grep 'transmission/web' | sed 's/\/web$//g'`
if [ -d "$rootFolder/web" ]; then
webFolder="$rootFolder/web"
folderIsExist=1
fi
fi
# if the folder does existthen do download and installation
if [ $folderIsExist = 1 ]; then
mkdir "$tmpFolder"
cd "$tmpFolder"
echo "Downloading Transmission Web Control..."
wget "$downloadurl"
echo "Installing..."
tar -xzf "$packname" -C "$tmpFolder"
rm "$packname"
# if did not install beforethen change the original system file name
if [ ! -f "$webFolder/$orgindex" -a -f "$webFolder/$index" ]; then
mv "$webFolder/$index" "$webFolder/$orgindex"
fi
# copy the files to folder
cp -r web "$rootFolder"
find "$rootFolder" -type d -exec chmod o+rx {} \;
find "$rootFolder" -type f -exec chmod o+r {} \;
echo "Done."
else
echo "##############################################"
echo "#"
echo "# ERROR : Transmisson WEB UI Folder is missing."
echo "#"
echo "##############################################"
fi
rm -rf "$tmpFolder"

View File

@ -1,57 +0,0 @@
#!/bin/sh
rootFolder=""
webFolder=""
orgindex="index.original.html"
index="index.html"
tmpFolder="/tmp/tr-web-control"
packname="transmission-control-full.tar.gz"
host="https://github.com/ronggang/transmission-web-control/raw/master/release/"
downloadurl="$host$packname"
if [ ! -d "$tmpFolder" ]; then
mkdir -p "$tmpFolder"
fi
# 找出web ui 目录
folderIsExist=0
echo "Searching Transmission Web Folder..."
rootFolder="/usr/share/transmission"
echo "Looking for folder: $rootFolder/web"
if [ -d "$rootFolder/web" ]; then
webFolder="$rootFolder/web"
folderIsExist=1
echo "Folder found. Using it."
else
echo "Folder not found. Will search the entire /. This will take a while..."
rootFolder=`find / -name 'web' -type d 2>/dev/null| grep 'transmission/web' | sed 's/\/web$//g'`
if [ -d "$rootFolder/web" ]; then
webFolder="$rootFolder/web"
folderIsExist=1
fi
fi
# 如果目录存在,则进行下载和更新动作
if [ $folderIsExist = 1 ]; then
mkdir "$tmpFolder"
cd "$tmpFolder"
echo "Downloading Transmission Web Control..."
wget "$downloadurl"
echo "Installing..."
tar -xzf "$packname" -C "$tmpFolder"
rm "$packname"
# 如果之前没有安装过,则先将原系统的文件改为
if [ ! -f "$webFolder/$orgindex" -a -f "$webFolder/$index" ]; then
mv "$webFolder/$index" "$webFolder/$orgindex"
fi
# 复制文件到
cp -r web "$rootFolder"
find "$rootFolder" -type d -exec chmod o+rx {} \;
find "$rootFolder" -type f -exec chmod o+r {} \;
echo "Done."
else
echo "##############################################"
echo "#"
echo "# ERROR : Transmisson WEB UI Folder is missing."
echo "#"
echo "##############################################"
fi
rm -rf "$tmpFolder"