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",
|
"java": "1.17.1",
|
||||||
"bedrock": "1.17.31.01",
|
"bedrock": "1.17.31.01",
|
||||||
"pocketmine": "4.0.0-BETA3",
|
"pocketmine": "4.0.0-BETA3",
|
||||||
"spigot": "1.17.1"
|
"spigot": "1.17.1",
|
||||||
|
"dragonfly": "1.17.30"
|
||||||
},
|
},
|
||||||
"java": {
|
"java": {
|
||||||
"1.17.1": {
|
"1.17.1": {
|
||||||
@ -926,5 +927,28 @@
|
|||||||
"version": "1.4.6",
|
"version": "1.4.6",
|
||||||
"url": "https://getbukkit.org/get/29mixbrJ32rlDGLn8L3dIe4jvkLPdgom"
|
"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,
|
java: null,
|
||||||
bedrock: null,
|
bedrock: null,
|
||||||
pocketmine: null,
|
pocketmine: null,
|
||||||
spigot: null
|
spigot: null,
|
||||||
|
dragonfly: null
|
||||||
},
|
},
|
||||||
java: {},
|
java: {},
|
||||||
bedrock: {},
|
bedrock: {},
|
||||||
pocketmine: {},
|
pocketmine: {},
|
||||||
spigot: {}
|
spigot: {},
|
||||||
|
dragonfly: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get Pre URLs
|
// Get Pre URLs
|
||||||
@ -161,6 +163,49 @@ async function CreateLibZIP(url = "") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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
|
// Spigot
|
||||||
new_Server.spigot = await Spigot_Lint();
|
new_Server.spigot = await Spigot_Lint();
|
||||||
new_Server.latest.spigot = new_Server.spigot[0].version
|
new_Server.latest.spigot = new_Server.spigot[0].version
|
||||||
@ -175,6 +220,9 @@ async function CreateLibZIP(url = "") {
|
|||||||
// pocketmine
|
// pocketmine
|
||||||
for (let PocketMine of Object.getOwnPropertyNames(oldServer.pocketmine)){new_Server.pocketmine[PocketMine] = oldServer.pocketmine[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
|
// Create git commit template
|
||||||
const git_commit_template = ["# Server.json update", ""];
|
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.java)) new_Server.latest.java = oldServer.latest.java;
|
||||||
if (!(new_Server.latest.pocketmine)) new_Server.latest.pocketmine = oldServer.latest.pocketmine;
|
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.spigot)) new_Server.latest.spigot = oldServer.latest.spigot;
|
||||||
|
if (!(new_Server.latest.dragonfly)) new_Server.latest.dragonfly = oldServer.latest.dragonfly
|
||||||
|
|
||||||
// Bedrock
|
// Bedrock
|
||||||
if (oldServer.latest.bedrock === new_Server.latest.bedrock) {
|
if (oldServer.latest.bedrock === new_Server.latest.bedrock) {
|
||||||
@ -227,6 +276,17 @@ async function CreateLibZIP(url = "") {
|
|||||||
console.log(SpigotTextUpdate);
|
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
|
// Write commit file
|
||||||
writeFileSync(resolve(__dirname, "../.commit_template.md"), git_commit_template.join("\n"));
|
writeFileSync(resolve(__dirname, "../.commit_template.md"), git_commit_template.join("\n"));
|
||||||
|
|
||||||
@ -238,4 +298,5 @@ async function CreateLibZIP(url = "") {
|
|||||||
exportVariable("java_version", new_Server.latest.java);
|
exportVariable("java_version", new_Server.latest.java);
|
||||||
exportVariable("bedrock_version", new_Server.latest.bedrock);
|
exportVariable("bedrock_version", new_Server.latest.bedrock);
|
||||||
exportVariable("spigot_version", new_Server.latest.spigot);
|
exportVariable("spigot_version", new_Server.latest.spigot);
|
||||||
|
exportVariable("dragonfly_version", new_Server.latest.dragonfly);
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user