a2server/scripts/a2server-1-storage.txt

26 lines
865 B
Plaintext
Raw Normal View History

#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
# --- Setting up the share volume
2015-12-10 01:39:09 +00:00
# 1.3.0: move /media/A2SHARED (pre-1.3.0) to /srv/A2SERVER
if [[ -d /media/A2SHARED ]]; then
echo "A2SERVER: Moving /media/A2SHARED to /srv/A2SERVER..."
sudo /etc/init.d/netatalk stop &> /dev/null
sudo /etc/init.d/samba stop &> /dev/null
[[ ! -d /srv ]] && sudo mkdir -p /srv
sudo mv /media/A2SHARED /srv/A2SERVER
sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /usr/local/etc/netatalk/AppleVolumes.default
if [[ -f /etc/samba/smbd.conf ]]; then
sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /etc/samba/smbd.conf
fi
2015-12-10 01:39:09 +00:00
fi
if [[ ! -d /srv/A2SERVER ]]; then
echo "A2SERVER: Preparing the shared files volume..."
sudo mkdir -p /srv/A2SERVER
sudo chown $USER:$USER /srv/A2SERVER
else
echo "A2SERVER: Shared volume is already prepared for use."
fi