2015-10-09 12:29:32 +00:00
|
|
|
#! /bin/bash
|
2016-10-25 19:09:52 +00:00
|
|
|
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
|
2015-10-03 12:25:44 +00:00
|
|
|
|
|
|
|
# --- 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
|
2016-10-25 19:09:52 +00:00
|
|
|
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
|
2016-10-27 07:55:16 +00:00
|
|
|
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
|
2015-10-03 12:25:44 +00:00
|
|
|
|
2016-10-27 07:55:16 +00:00
|
|
|
if [[ ! -d /srv/A2SERVER ]]; then
|
2016-10-25 19:09:52 +00:00
|
|
|
echo "A2SERVER: Preparing the shared files volume..."
|
|
|
|
sudo mkdir -p /srv/A2SERVER
|
|
|
|
sudo chown $USER:$USER /srv/A2SERVER
|
2016-10-27 07:55:16 +00:00
|
|
|
else
|
|
|
|
echo "A2SERVER: Shared volume is already prepared for use."
|
2015-10-09 12:29:32 +00:00
|
|
|
fi
|