a2server/scripts/a2server-1-storage.txt
T. Joseph Carter 8897610d95 Scripts: re-indent (tab indentation)
One of the reasons I held off on doing this before is that there are a
lot of complex one-line seds in here that I expect _will_ be broken by
this.  More than a few of these will assume, depend on, require, and
break if specific hardcoded whitespace is not found.  That's problematic
anyway--when whitespace isn't syntactic, you shouldn't do that.  So it's
time to fix these anyway.
2016-10-25 12:12:11 -07:00

32 lines
889 B
Bash
Executable File

#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
# --- Setting up the share volume
# 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
[[ -f /etc/samba/smbd.conf ]] && sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /etc/samba/smbd.conf
fi
# skip if we're already set up
if [[ -d /srv/A2SERVER ]]; then
echo "A2SERVER: Shared volume is already prepared for use."
else
echo "A2SERVER: Preparing the shared files volume..."
sudo mkdir -p /srv/A2SERVER
sudo chown $USER:$USER /srv/A2SERVER
fi