#!/bin/bash
#自动下载By Liliya233 github.com存放的最新omega启动器并判断文件md5值将md5值并写入文件
#使用宝塔计划任务每天定时执行，保证最新
cd /www/wwwroot/likemc.xyz/binary
#download Liliya233的omega启动器
rm -rf omega_launcher_android_arm64 omega_launcher_darwin_amd64 omega_launcher_linux_amd64 omega_launcher_windows_amd64.exe omega_launcher_windows_arm64.exe omega_launcher_android_amd64 omega_launcher_darwin_arm64
wget https://github.com/Liliya233/omega_launcher/releases/latest/download/omega_launcher_android_arm64
mv omega_launcher_android_arm64 launcher-android
wget https://github.com/Liliya233/omega_launcher/releases/latest/download/omega_launcher_darwin_amd64
mv omega_launcher_darwin_amd64 launcher-macos
wget https://github.com/Liliya233/omega_launcher/releases/latest/download/omega_launcher_linux_amd64
mv omega_launcher_linux_amd64 launcher-linux
wget https://github.com/Liliya233/omega_launcher/releases/latest/download/omega_launcher_windows_amd64.exe
wget https://github.com/Liliya233/omega_launcher/releases/latest/download/omega_launcher_windows_arm64.exe
wget https://github.com/Liliya233/omega_launcher/releases/latest/download/omega_launcher_android_amd64
wget https://github.com/Liliya233/omega_launcher/releases/latest/download/omega_launcher_darwin_arm64

#android
out_str="$(md5sum launcher-android)"
out_hash="$(echo $out_str | cut -d' ' -f1)"
touch launcher-android.hash
echo $out_hash > launcher-android.hash
#echo $out_hash
cat launcher-android.hash
clear
#linux
out_str="$(md5sum launcher-linux)"
out_hash="$(echo $out_str | cut -d' ' -f1)"
touch launcher-linux.hash
echo $out_hash > launcher-linux.hash
#echo $out_hash
cat launcher-linux.hash
clear
#macos
out_str="$(md5sum launcher-macos)"
out_hash="$(echo $out_str | cut -d' ' -f1)"
touch launcher-macos.hash
echo $out_hash > launcher-macos.hash
#echo $out_hash
cat launcher-macos.hash
clear
echo 执行完成啦