Skip to content

Commit bb957cd

Browse files
committed
scripts for mapping azure blob music
1 parent 9c3069f commit bb957cd

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

files/default/mnt_music.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Script to mount the volume to Windows.
2+
## In Subsonic, set the FOLDER to '\\butlersa.file.core.windows.net\music'
3+
## The Subsonic Service needs to run as the .\ubuntu user for mapped network drives to work
4+
5+
$connectTestResult = Test-NetConnection -ComputerName butlersa.file.core.windows.net -Port 445
6+
if ($connectTestResult.TcpTestSucceeded) {
7+
# Save the password so the drive will persist on reboot
8+
cmd.exe /C "cmdkey /add:`"butlersa.file.core.windows.net`" /user:`"localhost\butlersa`" /pass:`"ZBqqVpmQ2Wz7Lupa4ic0C2VdRNxCyJUzfA3MsPsW8T1WayIX2WBMO/ft0A0PoLQMsXMKdmoNZp1D+LrW+IToXw==`""
9+
# Mount the drive
10+
New-PSDrive -Name M -PSProvider FileSystem -Root "\\butlersa.file.core.windows.net\music" -Persist
11+
} else {
12+
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
13+
}

files/default/mnt_music.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sudo mkdir /mnt/music
2+
if [ ! -d "/etc/smbcredentials" ]; then
3+
sudo mkdir /etc/smbcredentials
4+
fi
5+
if [ ! -f "/etc/smbcredentials/butlersa.cred" ]; then
6+
sudo bash -c 'echo "username=butlersa" >> /etc/smbcredentials/butlersa.cred'
7+
sudo bash -c 'echo "password=ZBqqVpmQ2Wz7Lupa4ic0C2VdRNxCyJUzfA3MsPsW8T1WayIX2WBMO/ft0A0PoLQMsXMKdmoNZp1D+LrW+IToXw==" >> /etc/smbcredentials/butlersa.cred'
8+
fi
9+
sudo chmod 600 /etc/smbcredentials/butlersa.cred
10+
11+
sudo bash -c 'echo "//butlersa.file.core.windows.net/music /mnt/music cifs nofail,credentials=/etc/smbcredentials/butlersa.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30" >> /etc/fstab'
12+
sudo mount -t cifs //butlersa.file.core.windows.net/music /mnt/music -o credentials=/etc/smbcredentials/butlersa.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30

0 commit comments

Comments
 (0)