|
|
@ -10,6 +10,7 @@ welcome () { |
|
|
|
echo "" |
|
|
|
echo "" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 显示结束语 |
|
|
|
theend () { |
|
|
|
theend () { |
|
|
|
echo "" |
|
|
|
echo "" |
|
|
|
echo "==感谢使用machete_installer==" |
|
|
|
echo "==感谢使用machete_installer==" |
|
|
@ -19,6 +20,20 @@ theend () { |
|
|
|
echo "" |
|
|
|
echo "" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 获取用户桌面绝对路径 |
|
|
|
|
|
|
|
getHomePath () { |
|
|
|
|
|
|
|
cd ~/ |
|
|
|
|
|
|
|
path=`pwd` |
|
|
|
|
|
|
|
cd - |
|
|
|
|
|
|
|
echo $path |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 获取本地局域网ip地址 |
|
|
|
|
|
|
|
getLocalIp () { |
|
|
|
|
|
|
|
ipstr=`ifconfig -a | grep -v grep | grep '192.168'` |
|
|
|
|
|
|
|
echo "${ipstr}" | cut -d ' ' -f 2 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# 获取mac mini的cpu芯片型号信息 |
|
|
|
# 获取mac mini的cpu芯片型号信息 |
|
|
|
getCpuInfo () { |
|
|
|
getCpuInfo () { |
|
|
|
cpu_info=`sysctl -n machdep.cpu.brand_string` |
|
|
|
cpu_info=`sysctl -n machdep.cpu.brand_string` |
|
|
@ -123,7 +138,8 @@ dockerStartAlbumContainer () { |
|
|
|
album_name="machete_album" |
|
|
|
album_name="machete_album" |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [ -z "${album_path}" ]; then |
|
|
|
if [ -z "${album_path}" ]; then |
|
|
|
album_path="~/Desktop/Album_by_filesite" |
|
|
|
homePath=`getHomePath` |
|
|
|
|
|
|
|
album_path="${homePath}/Album_by_filesite" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
docker run --name "${album_name}" \ |
|
|
|
docker run --name "${album_name}" \ |
|
|
@ -143,7 +159,8 @@ dockerStartVideoContainer () { |
|
|
|
blog_name="machete_videos" |
|
|
|
blog_name="machete_videos" |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [ -z "${blog_path}" ]; then |
|
|
|
if [ -z "${blog_path}" ]; then |
|
|
|
blog_path="~/Desktop/Videos_by_filesite" |
|
|
|
homePath=`getHomePath` |
|
|
|
|
|
|
|
blog_path="${homePath}/Videos_by_filesite" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
docker run --name "${blog_name}" \ |
|
|
|
docker run --name "${blog_name}" \ |
|
|
@ -209,12 +226,6 @@ downloadDockerDesktop () { |
|
|
|
open "${link}" |
|
|
|
open "${link}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# 获取本地局域网ip地址 |
|
|
|
|
|
|
|
getLocalIp () { |
|
|
|
|
|
|
|
ipstr=`ifconfig -a | grep -v grep | grep '192.168'` |
|
|
|
|
|
|
|
echo "${ipstr}" | cut -d ' ' -f 2 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 创建桌面快捷方式 |
|
|
|
# 创建桌面快捷方式 |
|
|
|
createShortcuts () { |
|
|
|
createShortcuts () { |
|
|
|
ip=`getLocalIp` |
|
|
|
ip=`getLocalIp` |
|
|
@ -316,9 +327,10 @@ containerName="machete_album" |
|
|
|
detectDockerContainerExists "${containerName}" |
|
|
|
detectDockerContainerExists "${containerName}" |
|
|
|
containerExist=$? |
|
|
|
containerExist=$? |
|
|
|
if [ $containerExist -eq 0 ]; then |
|
|
|
if [ $containerExist -eq 0 ]; then |
|
|
|
read -p "请输入相册保存路径后回车(默认保存到桌面~/Desktop/Album_by_filesite): " album_path |
|
|
|
read -p "请输入相册保存绝对路径后回车(默认保存到桌面Album_by_filesite): " album_path |
|
|
|
if [ -z "${album_path}" ]; then |
|
|
|
if [ -z "${album_path}" ]; then |
|
|
|
album_path="~/Desktop/Album_by_filesite" |
|
|
|
homePath=`getHomePath` |
|
|
|
|
|
|
|
album_path="${homePath}/Album_by_filesite" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ ! -d "${album_path}" ]; then |
|
|
|
if [ ! -d "${album_path}" ]; then |
|
|
@ -350,9 +362,10 @@ containerName="machete_vlog" |
|
|
|
detectDockerContainerExists "${containerName}" |
|
|
|
detectDockerContainerExists "${containerName}" |
|
|
|
containerExist=$? |
|
|
|
containerExist=$? |
|
|
|
if [ $containerExist -eq 0 ]; then |
|
|
|
if [ $containerExist -eq 0 ]; then |
|
|
|
read -p "请输入视频保存路径后回车(默认保存到桌面~/Desktop/Videos_by_filesite): " vlog_path |
|
|
|
read -p "请输入视频保存绝对路径后回车(默认保存到桌面Videos_by_filesite): " vlog_path |
|
|
|
if [ -z "${vlog_path}" ]; then |
|
|
|
if [ -z "${vlog_path}" ]; then |
|
|
|
vlog_path="~/Desktop/Videos_by_filesite" |
|
|
|
homePath=`getHomePath` |
|
|
|
|
|
|
|
vlog_path="${homePath}/Videos_by_filesite" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ ! -d "${vlog_path}" ]; then |
|
|
|
if [ ! -d "${vlog_path}" ]; then |
|
|
|