#! /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 if [[ -f /etc/samba/smbd.conf ]]; then sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /etc/samba/smbd.conf fi fi if [[ ! -d /srv/A2SERVER ]]; then echo "A2SERVER: Preparing the shared files volume..." mygroup="$(id -ng)" sudo install -d -m 755 -u "$USER" -g "$mygroup" "/srv/A2SERVER" else echo "A2SERVER: Shared volume is already prepared for use." fi