Push #23
@ -1,53 +0,0 @@
|
||||
#!/bin/bash
|
||||
# bash /tmp/add-azure-smb30.sh "ResouceGroup" "StorageAccount" "fileshare"
|
||||
if ! command -v az &> /dev/null;then
|
||||
echo "Install azure az"
|
||||
exit 1
|
||||
fi
|
||||
if ! command -v mount.cifs &> /dev/null;then
|
||||
echo "Install cifs-utils"
|
||||
echo "Debian/Ubuntu: # apt install cifs-utils"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${1}" ];then echo "Set Resouce Group"; read 1;fi
|
||||
if [ -z "${2}" ];then echo "Storage Account"; read 2;fi
|
||||
if [ -z "${3}" ];then echo "File Share Name"; read 3;fi
|
||||
|
||||
resourceGroupName="${1}"
|
||||
storageAccountName="${2}"
|
||||
fileShareName="${3}"
|
||||
more_option="gid=$EUID,uid=$EUID,file_mode=0775,dir_mode=0775"
|
||||
|
||||
httpEndpoint=$(az storage account show --resource-group $resourceGroupName --name $storageAccountName --query "primaryEndpoints.file" | tr -d '"')
|
||||
smbPath=$(echo $httpEndpoint | cut -c7-$(expr length $httpEndpoint))$fileShareName
|
||||
storageAccountKey=$(az storage account keys list --resource-group $resourceGroupName --account-name $storageAccountName --query "[0].value" | tr -d '"')
|
||||
mntPath="/mnt/$storageAccountName/$fileShareName"
|
||||
fileHost=$(echo $smbPath | tr -d "/")
|
||||
echo "$httpEndpoint,
|
||||
$mntPath,
|
||||
$mntPath,
|
||||
$storageAccountKey"
|
||||
|
||||
sudo umount $mntPath
|
||||
|
||||
sudo mkdir -p $mntPath
|
||||
sudo mount.cifs $smbPath $mntPath -o vers=3.0,username=$storageAccountName,password=$storageAccountKey,serverino,$more_option
|
||||
if [ ! -d "/etc/smbcredentials" ]; then
|
||||
sudo mkdir "/etc/smbcredentials"
|
||||
fi
|
||||
smbCredentialFile="/etc/smbcredentials/$storageAccountName.cred"
|
||||
if [ ! -f $smbCredentialFile ]; then
|
||||
echo "username=$storageAccountName" | sudo tee $smbCredentialFile > /dev/null
|
||||
echo "password=$storageAccountKey" | sudo tee -a $smbCredentialFile > /dev/null
|
||||
else
|
||||
echo "The credential file $smbCredentialFile already exists, and was not modified."
|
||||
fi
|
||||
sudo chmod 600 $smbCredentialFile
|
||||
if [ -z "$(grep $smbPath\ $mntPath /etc/fstab)" ]; then
|
||||
echo "$smbPath $mntPath cifs nofail,vers=3.0,credentials=$smbCredentialFile,serverino,$more_option 0 $((1 + $(cat /etc/fstab|awk '{print $6}'|tail -1)))" | sudo tee -a /etc/fstab > /dev/null
|
||||
else
|
||||
echo "/etc/fstab was not modified to avoid conflicting entries as this Azure file share was already present. You may want to double check /etc/fstab to ensure the configuration is as desired."
|
||||
fi
|
||||
|
||||
sudo mount -a
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28
Server.json
28
Server.json
@ -3,7 +3,8 @@
|
||||
"java": "1.17.1",
|
||||
"bedrock": "1.17.31.01",
|
||||
"pocketmine": "4.0.0-BETA3",
|
||||
"spigot": "1.17.1"
|
||||
"spigot": "1.17.1",
|
||||
"dragonfly": "1.17.30"
|
||||
},
|
||||
"java": {
|
||||
"1.17.1": {
|
||||
@ -926,5 +927,28 @@
|
||||
"version": "1.4.6",
|
||||
"url": "https://getbukkit.org/get/29mixbrJ32rlDGLn8L3dIe4jvkLPdgom"
|
||||
}
|
||||
]
|
||||
],
|
||||
"dragonfly": {
|
||||
"1.17.30": {
|
||||
"linux": {
|
||||
"aarch64": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_linux_arm64",
|
||||
"armv7": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_linux_arm",
|
||||
"amd64": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_linux_amd64",
|
||||
"i386": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_linux_386"
|
||||
},
|
||||
"win32": {
|
||||
"aarch64": null,
|
||||
"amd64": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_win32_amd64.exe",
|
||||
"i386": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_win32_386.exe"
|
||||
},
|
||||
"darwin": {
|
||||
"aarch64": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_darwin_arm64",
|
||||
"amd64": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_darwin_amd64"
|
||||
},
|
||||
"android": {
|
||||
"aarch64": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_android_arm64",
|
||||
"amd64": "https://github.com/The-Bds-Maneger/Dragonfly_Build/releases/download/1.17.30/Dragonfly_android_amd64"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -71,12 +71,14 @@ async function CreateLibZIP(url = "") {
|
||||
java: null,
|
||||
bedrock: null,
|
||||
pocketmine: null,
|
||||
spigot: null
|
||||
spigot: null,
|
||||
dragonfly: null
|
||||
},
|
||||
java: {},
|
||||
bedrock: {},
|
||||
pocketmine: {},
|
||||
spigot: {}
|
||||
spigot: {},
|
||||
dragonfly: {}
|
||||
}
|
||||
|
||||
// Get Pre URLs
|
||||
@ -148,7 +150,7 @@ async function CreateLibZIP(url = "") {
|
||||
console.log("Fetching latest versions to PocketMine-MP...");
|
||||
const pocketmine_json = [...await GetJson("https://api.github.com/repos/pmmp/PocketMine-MP/releases")];
|
||||
console.log(`Feched latest versions to PocketMine-MP! (${pocketmine_json[0].tag_name})\n`);
|
||||
|
||||
|
||||
new_Server.latest.pocketmine = pocketmine_json[0].tag_name
|
||||
for (let index of pocketmine_json){
|
||||
if (!(old_Server_file.includes(index.tag_name))) {
|
||||
@ -160,7 +162,50 @@ async function CreateLibZIP(url = "") {
|
||||
console.log(new_Server.pocketmine[index.tag_name]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Dragonfly
|
||||
console.log("Dragonfly Builds");
|
||||
const dragonfly_releases = [...(await GetJson("https://api.github.com/repos/The-Bds-Maneger/Dragonfly_Build/releases"))];
|
||||
new_Server.latest.dragonfly = dragonfly_releases[0].tag_name;
|
||||
const mapped_dragonfly = {}
|
||||
for (let Version of dragonfly_releases) {
|
||||
mapped_dragonfly[Version.tag_name] = {
|
||||
linux: {aarch64: null, armv7: null, amd64: null, i386: null},
|
||||
win32: {aarch64: null, amd64: null, i386: null},
|
||||
darwin: {aarch64: null, amd64: null},
|
||||
android: {aarch64: null, amd64: null}
|
||||
}
|
||||
for (let assents of Version.assets) {
|
||||
if (/linux/.test(assents.name)) {
|
||||
if (/arm64/.test(assents.name)) mapped_dragonfly[Version.tag_name].linux.aarch64 = assents.browser_download_url;
|
||||
else if (/arm/.test(assents.name)) mapped_dragonfly[Version.tag_name].linux.armv7 = assents.browser_download_url;
|
||||
else if (/amd64/.test(assents.name)) mapped_dragonfly[Version.tag_name].linux.amd64 = assents.browser_download_url;
|
||||
else if (/386/.test(assents.name)) mapped_dragonfly[Version.tag_name].linux.i386 = assents.browser_download_url;
|
||||
else console.log("Skip:", assents.name);
|
||||
} else if (/win32/.test(assents.name)) {
|
||||
if (/arm64/.test(assents.name)) mapped_dragonfly[Version.tag_name].win32.aarch64 = assents.browser_download_url;
|
||||
else if (/amd64/.test(assents.name)) mapped_dragonfly[Version.tag_name].win32.amd64 = assents.browser_download_url;
|
||||
else if (/386/.test(assents.name)) mapped_dragonfly[Version.tag_name].win32.i386 = assents.browser_download_url;
|
||||
else console.log("Skip:", assents.name);
|
||||
} else if (/darwin/.test(assents.name)) {
|
||||
if (/arm64/.test(assents.name)) mapped_dragonfly[Version.tag_name].darwin.aarch64 = assents.browser_download_url;
|
||||
else if (/amd64/.test(assents.name)) mapped_dragonfly[Version.tag_name].darwin.amd64 = assents.browser_download_url;
|
||||
else console.log("Skip:", assents.name);
|
||||
} else if (/android/.test(assents.name)) {
|
||||
if (/arm64/.test(assents.name)) mapped_dragonfly[Version.tag_name].android.aarch64 = assents.browser_download_url;
|
||||
else if (/amd64/.test(assents.name)) mapped_dragonfly[Version.tag_name].android.amd64 = assents.browser_download_url;
|
||||
else console.log("Skip:", assents.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(mapped_dragonfly);
|
||||
for (let DragonflyVersion2 of Object.getOwnPropertyNames(mapped_dragonfly)) {
|
||||
if (!(oldServer.dragonfly)) new_Server.dragonfly = mapped_dragonfly;
|
||||
else {
|
||||
if (!(oldServer.dragonfly[DragonflyVersion2])) new_Server.dragonfly[DragonflyVersion2] = mapped_dragonfly[DragonflyVersion2];
|
||||
}
|
||||
}
|
||||
|
||||
// Spigot
|
||||
new_Server.spigot = await Spigot_Lint();
|
||||
new_Server.latest.spigot = new_Server.spigot[0].version
|
||||
@ -174,7 +219,10 @@ async function CreateLibZIP(url = "") {
|
||||
|
||||
// pocketmine
|
||||
for (let PocketMine of Object.getOwnPropertyNames(oldServer.pocketmine)){new_Server.pocketmine[PocketMine] = oldServer.pocketmine[PocketMine]}
|
||||
|
||||
|
||||
// Dragonfly
|
||||
for (let Dragonfly of Object.getOwnPropertyNames(oldServer.dragonfly)) {new_Server.dragonfly[Dragonfly] = oldServer.dragonfly[Dragonfly]}
|
||||
|
||||
// Create git commit template
|
||||
const git_commit_template = ["# Server.json update", ""];
|
||||
|
||||
@ -182,6 +230,7 @@ async function CreateLibZIP(url = "") {
|
||||
if (!(new_Server.latest.java)) new_Server.latest.java = oldServer.latest.java;
|
||||
if (!(new_Server.latest.pocketmine)) new_Server.latest.pocketmine = oldServer.latest.pocketmine;
|
||||
if (!(new_Server.latest.spigot)) new_Server.latest.spigot = oldServer.latest.spigot;
|
||||
if (!(new_Server.latest.dragonfly)) new_Server.latest.dragonfly = oldServer.latest.dragonfly
|
||||
|
||||
// Bedrock
|
||||
if (oldServer.latest.bedrock === new_Server.latest.bedrock) {
|
||||
@ -227,15 +276,27 @@ async function CreateLibZIP(url = "") {
|
||||
console.log(SpigotTextUpdate);
|
||||
}
|
||||
|
||||
// Dragonfly
|
||||
if (oldServer.latest.dragonfly === new_Server.latest.dragonfly) {
|
||||
const DgTextUpToDate = `- Dragonfly up to date (${new_Server.latest.dragonfly})\n`;
|
||||
git_commit_template.push(DgTextUpToDate);
|
||||
console.log(DgTextUpToDate);
|
||||
} else {
|
||||
const DgTextUpdate = `- Dragonfly Update ${oldServer.latest.dragonfly} to ${new_Server.latest.dragonfly}`;
|
||||
git_commit_template.push(DgTextUpdate);
|
||||
console.log(DgTextUpdate);
|
||||
}
|
||||
|
||||
// Write commit file
|
||||
writeFileSync(resolve(__dirname, "../.commit_template.md"), git_commit_template.join("\n"));
|
||||
|
||||
|
||||
// Write Server.json file
|
||||
writeFileSync(Server_path, JSON.stringify(new_Server, null, 4));
|
||||
|
||||
|
||||
// Export variables
|
||||
exportVariable("pocketmine_version", new_Server.latest.pocketmine);
|
||||
exportVariable("java_version", new_Server.latest.java);
|
||||
exportVariable("bedrock_version", new_Server.latest.bedrock);
|
||||
exportVariable("spigot_version", new_Server.latest.spigot);
|
||||
exportVariable("dragonfly_version", new_Server.latest.dragonfly);
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user