Add a tahoelafs introducer to the full install

This commit is contained in:
Bob Mottram 2016-08-29 10:48:49 +01:00
parent e187ab9ce2
commit 3856005b72
15 changed files with 4492 additions and 4432 deletions

View File

@ -107,7 +107,7 @@ function restore_local_blog {
fi fi
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post ]; then if [ -d /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post ]; then
mv /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/*.md /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post mv /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/*.md /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post
fi fi
@ -159,7 +159,7 @@ function restore_remote_blog {
fi fi
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post ]; then if [ -d /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post ]; then
mv /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/*.md /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post mv /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/*.md /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs/content/$USERNAME/blog/uncategorized/post
fi fi

View File

@ -41,7 +41,7 @@ function upgrade_emacs {
function backup_local_emacs { function backup_local_emacs {
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d /home/$USERNAME/.emacs.d ]; then if [ -d /home/$USERNAME/.emacs.d ]; then
echo $"Backing up Emacs config for $USERNAME" echo $"Backing up Emacs config for $USERNAME"
if [ -f /home/$USERNAME/.emacs ]; then if [ -f /home/$USERNAME/.emacs ]; then
@ -59,7 +59,7 @@ function restore_local_emacs {
if [ -d $USB_MOUNT/backup/emacs ]; then if [ -d $USB_MOUNT/backup/emacs ]; then
for d in $USB_MOUNT/backup/emacs/*/ ; do for d in $USB_MOUNT/backup/emacs/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi

View File

@ -98,7 +98,7 @@ function restore_local_syncthing {
if [ -d $USB_MOUNT/backup/syncthing ]; then if [ -d $USB_MOUNT/backup/syncthing ]; then
for d in $USB_MOUNT/backup/syncthing/*/ ; do for d in $USB_MOUNT/backup/syncthing/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -186,7 +186,7 @@ function restore_remote_syncthing {
if [ -d $SERVER_DIRECTORY/backup/syncthing ]; then if [ -d $SERVER_DIRECTORY/backup/syncthing ]; then
for d in $SERVER_DIRECTORY/backup/syncthing/*/ ; do for d in $SERVER_DIRECTORY/backup/syncthing/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi

View File

@ -28,7 +28,7 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
VARIANTS='mesh' VARIANTS='full mesh'
TAHOELAFS_REPO="https://github.com/tahoe-lafs/tahoe-lafs" TAHOELAFS_REPO="https://github.com/tahoe-lafs/tahoe-lafs"
TAHOELAFS_COMMIT='30b421d48b3d1dae2ef507bf27a1f3816300cd92' TAHOELAFS_COMMIT='30b421d48b3d1dae2ef507bf27a1f3816300cd92'
@ -42,7 +42,7 @@ TAHOE_COMMAND="cd /var/lib/tahoelafs && venv/bin/tahoe"
function reconfigure_tahoelafs { function reconfigure_tahoelafs {
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d /home/$USERNAME/.tahoe ]; then if [ -d /home/$USERNAME/.tahoe ]; then
su -c "$TAHOE_COMMAND stop" - $USERNAME su -c "$TAHOE_COMMAND stop" - $USERNAME
rm -rf /home/$USERNAME/.tahoe rm -rf /home/$USERNAME/.tahoe
@ -257,17 +257,65 @@ function install_tahoelafs {
apt-get -y install build-essential python-pip python-dev libffi-dev libssl-dev python-virtualenv apt-get -y install build-essential python-pip python-dev libffi-dev libssl-dev python-virtualenv
git_clone $TAHOELAFS_REPO /var/lib/tahoelafs # create a user to run the introducer
cd /var/lib/tahoelafs if [ ! -d /home/tahoelafs ]; then
# add a gogs user account
adduser --disabled-login --gecos 'tahoe-lafs' tahoelafs
fi
if [ -d /home/tahoelafs/Maildir ]; then
rm -rf /home/tahoelafs/Maildir
fi
if [ ! -d /home/tahoelafs/.tahoe-introducer ]; then
mkdir /home/tahoelafs/.tahoe-introducer
fi
git_clone $TAHOELAFS_REPO /home/tahoelafs/tahoelafs
cd /home/tahoelafs/tahoelafs
git checkout $TAHOELAFS_COMMIT -b $TAHOELAFS_COMMIT git checkout $TAHOELAFS_COMMIT -b $TAHOELAFS_COMMIT
virtualenv venv virtualenv venv
venv/bin/pip install --editable . venv/bin/pip install --editable .
configure_firewall_for_tahoelafs configure_firewall_for_tahoelafs
reconfigure_tahoelafs
tahoelafs_update_script /usr/bin/update-tahoelafs
function_check cron_add_mins su -c "cd $TAHOE_COMMAND create-introducer /home/tahoelafs/.tahoe-introducer" - tahoelafs
cron_add_mins 1 "/usr/bin/update-tahoelafs 2> /dev/null" TAHOELAFS_CONFIG=/home/tahoelafs/.tahoe-introducer/tahoe.cfg
if [ ! -f $TAHOELAFS_CONFIG ]; then
exit 62831
fi
sed -i "s|nickname =.*|nickname = $HOSTNAME|g" $TAHOELAFS_CONFIG
if ! grep -q "[storage]" $TAHOELAFS_CONFIG; then
echo '' >> $TAHOELAFS_CONFIG
echo '[storage]' >> $TAHOELAFS_CONFIG
echo 'enabled = true' >> $TAHOELAFS_CONFIG
echo "reserved_space = $TAHOELAFS_STORAGE_SPACE" >> $TAHOELAFS_CONFIG
fi
chown -R tahoelafs:tahoelafs /home/tahoelafs
TAHOELAFS_DAEMON_FILE=/etc/systemd/system/tahoelafs.service
echo '[Unit]' > $TAHOELAFS_DAEMON_FILE
echo 'Description=Tahoe-LAFS introducer' >> $TAHOELAFS_DAEMON_FILE
echo 'After=syslog.target' >> $TAHOELAFS_DAEMON_FILE
echo 'After=network.target' >> $TAHOELAFS_DAEMON_FILE
echo '' >> $TAHOELAFS_DAEMON_FILE
echo '[Service]' >> $TAHOELAFS_DAEMON_FILE
echo 'Type=simple' >> $TAHOELAFS_DAEMON_FILE
echo "User=tahoelafs" >> $TAHOELAFS_DAEMON_FILE
echo "Group=tahoelafs" >> $TAHOELAFS_DAEMON_FILE
echo "WorkingDirectory=/home/tahoelafs" >> $TAHOELAFS_DAEMON_FILE
echo "ExecStart=venv/bin/tahoe start /home/tahoelafs/.tahoe-introducer" >> $TAHOELAFS_DAEMON_FILE
echo "ExecStop=venv/bin/tahoe stop /home/tahoelafs/.tahoe-introducer" >> $TAHOELAFS_DAEMON_FILE
echo 'Restart=on-failure' >> $TAHOELAFS_DAEMON_FILE
echo "Environment=\"USER=tahoelafs\" \"HOME=/home/tahoelafs\"" >> $TAHOELAFS_DAEMON_FILE
echo '' >> $TAHOELAFS_DAEMON_FILE
echo '[Install]' >> $TAHOELAFS_DAEMON_FILE
echo 'WantedBy=multi-user.target' >> $TAHOELAFS_DAEMON_FILE
systemctl enable tahoelafs
systemctl daemon-reload
systemctl start tahoelafs
echo 'install_tahoelafs' >> $COMPLETION_FILE echo 'install_tahoelafs' >> $COMPLETION_FILE
} }

View File

@ -234,7 +234,7 @@ function remove_xmpp {
function xmpp_email_headers { function xmpp_email_headers {
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -f /home/$USERNAME/.muttrc ]; then if [ -f /home/$USERNAME/.muttrc ]; then
if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then
echo "my_hdr Jabber-ID: ${USERNAME}@${HOSTNAME}" >> /home/$USERNAME/.muttrc echo "my_hdr Jabber-ID: ${USERNAME}@${HOSTNAME}" >> /home/$USERNAME/.muttrc

View File

@ -35,7 +35,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
# for every user who has a mail directory # for every user who has a mail directory
if [ -d /home/$USERNAME/Maildir ]; then if [ -d /home/$USERNAME/Maildir ]; then
MUTTRC=/home/$USERNAME/.muttrc MUTTRC=/home/$USERNAME/.muttrc

View File

@ -98,7 +98,7 @@ function backup_users {
# Backup user files # Backup user files
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
# Backup any gpg keys # Backup any gpg keys
if [ -d /home/$USERNAME/.gnupg ]; then if [ -d /home/$USERNAME/.gnupg ]; then

View File

@ -122,7 +122,7 @@ function backup_configuration {
function backup_users { function backup_users {
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
# personal settings # personal settings
if [ -d /home/$USERNAME/personal ]; then if [ -d /home/$USERNAME/personal ]; then
@ -451,7 +451,7 @@ do
# Social key management # Social key management
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
disperse_key_shares $USERNAME $REMOTE_DOMAIN $REMOTE_SSH_PORT "$REMOTE_PASSWORD" $REMOTE_SERVER disperse_key_shares $USERNAME $REMOTE_DOMAIN $REMOTE_SSH_PORT "$REMOTE_PASSWORD" $REMOTE_SERVER
fi fi
done done

View File

@ -1050,7 +1050,7 @@ function spam_filtering {
echo '#!/bin/bash' > /usr/bin/filterspam echo '#!/bin/bash' > /usr/bin/filterspam
echo 'for d in /home/*/ ; do' >> /usr/bin/filterspam echo 'for d in /home/*/ ; do' >> /usr/bin/filterspam
echo ' USERNAME=$(echo "$d" | awk -F '"'"'/'"'"' '"'"'{print $3}'"'"')' >> /usr/bin/filterspam echo ' USERNAME=$(echo "$d" | awk -F '"'"'/'"'"' '"'"'{print $3}'"'"')' >> /usr/bin/filterspam
echo ' if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then' >> /usr/bin/filterspam echo ' if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then' >> /usr/bin/filterspam
echo ' MAILDIR=/home/$USERNAME/Maildir/.learn-spam' >> /usr/bin/filterspam echo ' MAILDIR=/home/$USERNAME/Maildir/.learn-spam' >> /usr/bin/filterspam
echo ' if [ ! -d "$MAILDIR" ]; then' >> /usr/bin/filterspam echo ' if [ ! -d "$MAILDIR" ]; then' >> /usr/bin/filterspam
echo ' exit' >> /usr/bin/filterspam echo ' exit' >> /usr/bin/filterspam
@ -1072,7 +1072,7 @@ function spam_filtering {
echo '#!/bin/bash' > /usr/bin/filterham echo '#!/bin/bash' > /usr/bin/filterham
echo 'for d in /home/*/ ; do' >> /usr/bin/filterham echo 'for d in /home/*/ ; do' >> /usr/bin/filterham
echo ' USERNAME=$(echo "$d" | awk -F '"'"'/'"'"' '"'"'{print $3}'"'"')' >> /usr/bin/filterham echo ' USERNAME=$(echo "$d" | awk -F '"'"'/'"'"' '"'"'{print $3}'"'"')' >> /usr/bin/filterham
echo ' if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then' >> /usr/bin/filterham echo ' if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then' >> /usr/bin/filterham
echo ' MAILDIR=/home/$USERNAME/Maildir/.learn-ham' >> /usr/bin/filterham echo ' MAILDIR=/home/$USERNAME/Maildir/.learn-ham' >> /usr/bin/filterham
echo ' if [ ! -d "$MAILDIR" ]; then' >> /usr/bin/filterham echo ' if [ ! -d "$MAILDIR" ]; then' >> /usr/bin/filterham
echo ' exit' >> /usr/bin/filterham echo ' exit' >> /usr/bin/filterham

View File

@ -453,7 +453,7 @@ function show_users {
echo '--------------------------------------------------------------------------' echo '--------------------------------------------------------------------------'
for d in /home/*/ ; do for d in /home/*/ ; do
USRNAME=$(echo "$d" | awk -F '/' '{print $3}') USRNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USRNAME != "git" && $USRNAME != "mirrors" && $USRNAME != "sync" ]]; then if [[ $USRNAME != "git" && $USRNAME != "mirrors" && $USRNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
echo -n -e "$(pad_string ${USRNAME})" echo -n -e "$(pad_string ${USRNAME})"
# get the SIP extension # get the SIP extension
SIPEXT= SIPEXT=
@ -497,10 +497,22 @@ function show_mirrors_password {
echo '' echo ''
} }
function show_tahoe_introducer {
if [ ! -f /home/tahoelafs/.tahoe-introducer/private/introducer.furl ]; then
return
fi
echo 'Tahoe-LAFS'
echo '=========='
echo ''
cat /home/tahoelafs/.tahoe-introducer/private/introducer.furl
echo ''
}
function show_about { function show_about {
clear clear
show_domains show_domains
show_mirrors_password show_mirrors_password
show_tahoe_introducer
show_users show_users
any_key any_key
} }
@ -689,7 +701,7 @@ function irc_set_global_password {
# replace the password for all users # replace the password for all users
for d in /home/*/ ; do for d in /home/*/ ; do
IRC_USERNAME=$(echo "$d" | awk -F '/' '{print $3}') IRC_USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $IRC_USERNAME != "git" && $IRC_USERNAME != "mirrors" && $IRC_USERNAME != "sync" ]]; then if [[ $IRC_USERNAME != "git" && $IRC_USERNAME != "mirrors" && $IRC_USERNAME != "sync" && $IRC_USERNAME != "tahoelafs" ]]; then
if [ -f /home/$IRC_USERNAME/.irssi/config ]; then if [ -f /home/$IRC_USERNAME/.irssi/config ]; then
sed -i "s|$EXISTING_IRC_PASSWORD|$NEW_IRC_PASSWORD|g" /home/$IRC_USERNAME/.irssi/config sed -i "s|$EXISTING_IRC_PASSWORD|$NEW_IRC_PASSWORD|g" /home/$IRC_USERNAME/.irssi/config
chown -R $IRC_USERNAME:$IRC_USERNAME /home/$IRC_USERNAME/.irssi chown -R $IRC_USERNAME:$IRC_USERNAME /home/$IRC_USERNAME/.irssi

View File

@ -238,7 +238,7 @@ function restore_mutt_settings {
if [ -d $USB_MOUNT/backup/mutt ]; then if [ -d $USB_MOUNT/backup/mutt ]; then
for d in $USB_MOUNT/backup/mutt/*/ ; do for d in $USB_MOUNT/backup/mutt/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -272,7 +272,7 @@ function restore_gpg {
if [ -d $USB_MOUNT/backup/gnupg ]; then if [ -d $USB_MOUNT/backup/gnupg ]; then
for d in $USB_MOUNT/backup/gnupg/*/ ; do for d in $USB_MOUNT/backup/gnupg/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -309,7 +309,7 @@ function restore_procmail {
if [ -d $USB_MOUNT/backup/procmail ]; then if [ -d $USB_MOUNT/backup/procmail ]; then
for d in $USB_MOUNT/backup/procmail/*/ ; do for d in $USB_MOUNT/backup/procmail/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -338,7 +338,7 @@ function restore_spamassassin {
if [ -d $USB_MOUNT/backup/spamassassin ]; then if [ -d $USB_MOUNT/backup/spamassassin ]; then
for d in $USB_MOUNT/backup/spamassassin/*/ ; do for d in $USB_MOUNT/backup/spamassassin/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $USB_MOUNT/backup/spamassassin/$USERNAME ]; then if [ -d $USB_MOUNT/backup/spamassassin/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -399,7 +399,7 @@ function restore_user_ssh_keys {
if [ -d $USB_MOUNT/backup/ssh ]; then if [ -d $USB_MOUNT/backup/ssh ]; then
for d in $USB_MOUNT/backup/ssh/*/ ; do for d in $USB_MOUNT/backup/ssh/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -428,7 +428,7 @@ function restore_user_config {
if [ -d $USB_MOUNT/backup/config ]; then if [ -d $USB_MOUNT/backup/config ]; then
for d in $USB_MOUNT/backup/config/*/ ; do for d in $USB_MOUNT/backup/config/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -469,7 +469,7 @@ function restore_user_monkeysphere {
if [ -d $USB_MOUNT/backup/monkeysphere ]; then if [ -d $USB_MOUNT/backup/monkeysphere ]; then
for d in $USB_MOUNT/backup/monkeysphere/*/ ; do for d in $USB_MOUNT/backup/monkeysphere/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -508,7 +508,7 @@ function restore_user_fin {
if [ -d $USB_MOUNT/backup/fin ]; then if [ -d $USB_MOUNT/backup/fin ]; then
for d in $USB_MOUNT/backup/fin/*/ ; do for d in $USB_MOUNT/backup/fin/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -537,7 +537,7 @@ function restore_user_local {
if [ -d $USB_MOUNT/backup/local ]; then if [ -d $USB_MOUNT/backup/local ]; then
for d in $USB_MOUNT/backup/local/*/ ; do for d in $USB_MOUNT/backup/local/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi
@ -610,7 +610,7 @@ function restore_personal_settings {
if [ -d $USB_MOUNT/backup/personal ]; then if [ -d $USB_MOUNT/backup/personal ]; then
for d in $USB_MOUNT/backup/personal/*/ ; do for d in $USB_MOUNT/backup/personal/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $USB_MOUNT/backup/personal/$USERNAME ]; then if [ -d $USB_MOUNT/backup/personal/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -663,7 +663,7 @@ function restore_email {
if [ -d $USB_MOUNT/backup/mail ]; then if [ -d $USB_MOUNT/backup/mail ]; then
for d in $USB_MOUNT/backup/mail/*/ ; do for d in $USB_MOUNT/backup/mail/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
fi fi

View File

@ -225,7 +225,7 @@ function restore_mutt_settings {
fi fi
for d in $SERVER_DIRECTORY/backup/mutt/*/ ; do for d in $SERVER_DIRECTORY/backup/mutt/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/mutt/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/mutt/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -257,7 +257,7 @@ function restore_gpg {
fi fi
for d in $SERVER_DIRECTORY/backup/gnupg/*/ ; do for d in $SERVER_DIRECTORY/backup/gnupg/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/gnupg/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/gnupg/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -290,7 +290,7 @@ function restore_procmail {
fi fi
for d in $SERVER_DIRECTORY/backup/procmail/*/ ; do for d in $SERVER_DIRECTORY/backup/procmail/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/procmail/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/procmail/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -317,7 +317,7 @@ function restore_spamassassin {
fi fi
for d in $SERVER_DIRECTORY/backup/spamassassin/*/ ; do for d in $SERVER_DIRECTORY/backup/spamassassin/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/spamassassin/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/spamassassin/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -363,7 +363,7 @@ function restore_ssh_keys {
fi fi
for d in $SERVER_DIRECTORY/backup/ssh/*/ ; do for d in $SERVER_DIRECTORY/backup/ssh/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/ssh/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/ssh/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -390,7 +390,7 @@ function restore_user_config {
fi fi
for d in $SERVER_DIRECTORY/backup/config/*/ ; do for d in $SERVER_DIRECTORY/backup/config/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/config/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/config/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -429,7 +429,7 @@ function restore_user_monkeysphere {
fi fi
for d in $SERVER_DIRECTORY/backup/monkeysphere/*/ ; do for d in $SERVER_DIRECTORY/backup/monkeysphere/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/monkeysphere/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/monkeysphere/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -466,7 +466,7 @@ function restore_user_fin {
fi fi
for d in $SERVER_DIRECTORY/backup/fin/*/ ; do for d in $SERVER_DIRECTORY/backup/fin/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/fin/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/fin/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -493,7 +493,7 @@ function restore_user_local {
fi fi
for d in $SERVER_DIRECTORY/backup/local/*/ ; do for d in $SERVER_DIRECTORY/backup/local/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/local/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/local/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -561,7 +561,7 @@ function restore_personal_settings {
fi fi
for d in $SERVER_DIRECTORY/backup/personal/*/ ; do for d in $SERVER_DIRECTORY/backup/personal/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/personal/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/personal/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME
@ -608,7 +608,7 @@ function restore_email {
fi fi
for d in $SERVER_DIRECTORY/backup/mail/*/ ; do for d in $SERVER_DIRECTORY/backup/mail/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $6}') USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -d $SERVER_DIRECTORY/backup/mail/$USERNAME ]; then if [ -d $SERVER_DIRECTORY/backup/mail/$USERNAME ]; then
if [ ! -d /home/$USERNAME ]; then if [ ! -d /home/$USERNAME ]; then
${PROJECT_NAME}-adduser $USERNAME ${PROJECT_NAME}-adduser $USERNAME

View File

@ -336,7 +336,7 @@ function send_monkeysphere_server_keys_to_users {
monkeysphere_server_keys=$(monkeysphere-host show-key | grep $"OpenPGP fingerprint" | awk -F ' ' '{print $3}') monkeysphere_server_keys=$(monkeysphere-host show-key | grep $"OpenPGP fingerprint" | awk -F ' ' '{print $3}')
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ ! -d /home/$USERNAME/.monkeysphere ]; then if [ ! -d /home/$USERNAME/.monkeysphere ]; then
mkdir /home/$USERNAME/.monkeysphere mkdir /home/$USERNAME/.monkeysphere
fi fi
@ -952,7 +952,7 @@ function export_settings {
function refresh_gpg_keys { function refresh_gpg_keys {
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
su -c 'gpg --refresh-keys' - $USERNAME su -c 'gpg --refresh-keys' - $USERNAME
fi fi
done done

View File

@ -97,7 +97,7 @@ function create_syncthing_config {
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
echo " <folder id=\"$USERNAME\" path=\"/home/$USERNAME/Sync/\" ro=\"false\" rescanIntervalS=\"60\" ignorePerms=\"false\" autoNormalize=\"true\">" >> $SYNCTHING_CONFIG_FILE echo " <folder id=\"$USERNAME\" path=\"/home/$USERNAME/Sync/\" ro=\"false\" rescanIntervalS=\"60\" ignorePerms=\"false\" autoNormalize=\"true\">" >> $SYNCTHING_CONFIG_FILE
# include any specified device IDs for this user # include any specified device IDs for this user
if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then
@ -137,7 +137,7 @@ function create_syncthing_config {
echo "" > $TEMP_IDS_FILE echo "" > $TEMP_IDS_FILE
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then
while read -r line || [[ -n "$line" ]]; do while read -r line || [[ -n "$line" ]]; do
line2="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" line2="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
@ -177,7 +177,7 @@ function create_syncthing_config {
echo "" > $TEMP_IDS_FILE echo "" > $TEMP_IDS_FILE
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then
while read -r line || [[ -n "$line" ]]; do while read -r line || [[ -n "$line" ]]; do
line2="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" line2="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
@ -236,7 +236,7 @@ function create_syncthing_config {
# This allows it to appear within the user control panel # This allows it to appear within the user control panel
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
echo "$SYNCTHING_ID" > /home/$USERNAME/.syncthing-server-id echo "$SYNCTHING_ID" > /home/$USERNAME/.syncthing-server-id
chown $USERNAME:$USERNAME /home/$USERNAME/.syncthing-server-id chown $USERNAME:$USERNAME /home/$USERNAME/.syncthing-server-id
fi fi
@ -257,7 +257,7 @@ function user_devices_changed {
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
if [ -f /home/$USERNAME/$SYNCTHING_UPDATE_FILE ]; then if [ -f /home/$USERNAME/$SYNCTHING_UPDATE_FILE ]; then
CHANGED=1 CHANGED=1
fi fi

View File

@ -275,7 +275,7 @@ function set_user_permissions {
echo $"Setting permissions" echo $"Setting permissions"
for d in /home/*/ ; do for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}') USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" && $USERNAME != "tahoelafs" ]]; then
chown -R $USERNAME:$USERNAME /home/$USERNAME chown -R $USERNAME:$USERNAME /home/$USERNAME
fi fi
done done