quotes
This commit is contained in:
parent
55a446e0b3
commit
907791ddbb
|
@ -244,7 +244,7 @@ function restore_local_blog {
|
|||
fi
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; 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
|
||||
fi
|
||||
|
@ -296,7 +296,7 @@ function restore_remote_blog {
|
|||
fi
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; 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
|
||||
fi
|
||||
|
|
|
@ -49,7 +49,7 @@ function upgrade_emacs {
|
|||
function backup_local_emacs {
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d /home/$USERNAME/.emacs.d ]; then
|
||||
echo $"Backing up Emacs config for $USERNAME"
|
||||
if [ -f /home/$USERNAME/.emacs ]; then
|
||||
|
@ -67,7 +67,7 @@ function restore_local_emacs {
|
|||
if [ -d $USB_MOUNT/backup/emacs ]; then
|
||||
for d in $USB_MOUNT/backup/emacs/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
|
|
@ -61,7 +61,7 @@ function irc_set_global_password {
|
|||
# replace the password for all users
|
||||
for d in /home/*/ ; do
|
||||
IRC_USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $IRC_USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$IRC_USERNAME") == "1" ]]; then
|
||||
if [ -f /home/$IRC_USERNAME/.irssi/config ]; then
|
||||
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
|
||||
|
|
|
@ -278,7 +278,7 @@ function restore_local_syncthing {
|
|||
if [ -d $USB_MOUNT/backup/syncthing ]; then
|
||||
for d in $USB_MOUNT/backup/syncthing/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -366,7 +366,7 @@ function restore_remote_syncthing {
|
|||
if [ -d $SERVER_DIRECTORY/backup/syncthing ]; then
|
||||
for d in $SERVER_DIRECTORY/backup/syncthing/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
|
|
@ -50,7 +50,7 @@ function change_password_tahoelafs {
|
|||
function reconfigure_tahoelafs {
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d /home/$USERNAME/.tahoe ]; then
|
||||
su -c "$TAHOE_COMMAND stop" - $USERNAME
|
||||
rm -rf /home/$USERNAME/.tahoe
|
||||
|
|
|
@ -246,7 +246,7 @@ function remove_xmpp {
|
|||
function xmpp_email_headers {
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -f /home/$USERNAME/.muttrc ]; then
|
||||
if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then
|
||||
echo "my_hdr Jabber-ID: ${USERNAME}@${HOSTNAME}" >> /home/$USERNAME/.muttrc
|
||||
|
|
|
@ -37,7 +37,7 @@ source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-validation
|
|||
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
# for every user who has a mail directory
|
||||
if [ -d /home/$USERNAME/Maildir ]; then
|
||||
MUTTRC=/home/$USERNAME/.muttrc
|
||||
|
|
|
@ -98,7 +98,7 @@ function backup_users {
|
|||
# Backup user files
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
|
||||
# Backup any gpg keys
|
||||
if [ -d /home/$USERNAME/.gnupg ]; then
|
||||
|
|
|
@ -122,7 +122,7 @@ function backup_configuration {
|
|||
function backup_users {
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
|
||||
# personal settings
|
||||
if [ -d /home/$USERNAME/personal ]; then
|
||||
|
@ -451,7 +451,7 @@ do
|
|||
# Social key management
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
disperse_key_shares $USERNAME $REMOTE_DOMAIN $REMOTE_SSH_PORT "$REMOTE_PASSWORD" $REMOTE_SERVER
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -459,7 +459,7 @@ function show_users {
|
|||
echo '--------------------------------------------------------------------------'
|
||||
for d in /home/*/ ; do
|
||||
USRNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USRNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USRNAME") == "1" ]]; then
|
||||
echo -n -e "$(pad_string ${USRNAME})"
|
||||
# get the SIP extension
|
||||
SIPEXT=
|
||||
|
|
|
@ -238,7 +238,7 @@ function restore_mutt_settings {
|
|||
if [ -d $USB_MOUNT/backup/mutt ]; then
|
||||
for d in $USB_MOUNT/backup/mutt/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -272,7 +272,7 @@ function restore_gpg {
|
|||
if [ -d $USB_MOUNT/backup/gnupg ]; then
|
||||
for d in $USB_MOUNT/backup/gnupg/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -309,7 +309,7 @@ function restore_procmail {
|
|||
if [ -d $USB_MOUNT/backup/procmail ]; then
|
||||
for d in $USB_MOUNT/backup/procmail/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -338,7 +338,7 @@ function restore_spamassassin {
|
|||
if [ -d $USB_MOUNT/backup/spamassassin ]; then
|
||||
for d in $USB_MOUNT/backup/spamassassin/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $USB_MOUNT/backup/spamassassin/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -399,7 +399,7 @@ function restore_user_ssh_keys {
|
|||
if [ -d $USB_MOUNT/backup/ssh ]; then
|
||||
for d in $USB_MOUNT/backup/ssh/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -428,7 +428,7 @@ function restore_user_config {
|
|||
if [ -d $USB_MOUNT/backup/config ]; then
|
||||
for d in $USB_MOUNT/backup/config/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -469,7 +469,7 @@ function restore_user_monkeysphere {
|
|||
if [ -d $USB_MOUNT/backup/monkeysphere ]; then
|
||||
for d in $USB_MOUNT/backup/monkeysphere/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -508,7 +508,7 @@ function restore_user_fin {
|
|||
if [ -d $USB_MOUNT/backup/fin ]; then
|
||||
for d in $USB_MOUNT/backup/fin/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -537,7 +537,7 @@ function restore_user_local {
|
|||
if [ -d $USB_MOUNT/backup/local ]; then
|
||||
for d in $USB_MOUNT/backup/local/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
@ -610,7 +610,7 @@ function restore_personal_settings {
|
|||
if [ -d $USB_MOUNT/backup/personal ]; then
|
||||
for d in $USB_MOUNT/backup/personal/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $USB_MOUNT/backup/personal/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -663,7 +663,7 @@ function restore_email {
|
|||
if [ -d $USB_MOUNT/backup/mail ]; then
|
||||
for d in $USB_MOUNT/backup/mail/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
fi
|
||||
|
|
|
@ -227,7 +227,7 @@ function restore_mutt_settings {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/mutt/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/mutt/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -259,7 +259,7 @@ function restore_gpg {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/gnupg/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/gnupg/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -292,7 +292,7 @@ function restore_procmail {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/procmail/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/procmail/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -319,7 +319,7 @@ function restore_spamassassin {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/spamassassin/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/spamassassin/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -365,7 +365,7 @@ function restore_ssh_keys {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/ssh/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/ssh/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -392,7 +392,7 @@ function restore_user_config {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/config/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/config/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -431,7 +431,7 @@ function restore_user_monkeysphere {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/monkeysphere/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/monkeysphere/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -468,7 +468,7 @@ function restore_user_fin {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/fin/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/fin/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -495,7 +495,7 @@ function restore_user_local {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/local/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/local/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -563,7 +563,7 @@ function restore_personal_settings {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/personal/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/personal/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
@ -610,7 +610,7 @@ function restore_email {
|
|||
fi
|
||||
for d in $SERVER_DIRECTORY/backup/mail/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d $SERVER_DIRECTORY/backup/mail/$USERNAME ]; then
|
||||
if [ ! -d /home/$USERNAME ]; then
|
||||
${PROJECT_NAME}-adduser $USERNAME
|
||||
|
|
|
@ -338,7 +338,7 @@ function send_monkeysphere_server_keys_to_users {
|
|||
monkeysphere_server_keys=$(monkeysphere-host show-key | grep $"OpenPGP fingerprint" | awk -F ' ' '{print $3}')
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ ! -d /home/$USERNAME/.monkeysphere ]; then
|
||||
mkdir /home/$USERNAME/.monkeysphere
|
||||
fi
|
||||
|
@ -956,7 +956,7 @@ function export_settings {
|
|||
function refresh_gpg_keys {
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
su -c 'gpg --refresh-keys' - $USERNAME
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -99,7 +99,7 @@ function create_syncthing_config {
|
|||
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
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
|
||||
if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then
|
||||
|
@ -139,7 +139,7 @@ function create_syncthing_config {
|
|||
echo "" > $TEMP_IDS_FILE
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
line2="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||
|
@ -179,7 +179,7 @@ function create_syncthing_config {
|
|||
echo "" > $TEMP_IDS_FILE
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -f /home/$USERNAME/$SYNCTHING_USER_IDS_FILE ]; then
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
line2="$(echo -e "${line}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||
|
@ -238,7 +238,7 @@ function create_syncthing_config {
|
|||
# This allows it to appear within the user control panel
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
echo "$SYNCTHING_ID" > /home/$USERNAME/.syncthing-server-id
|
||||
chown $USERNAME:$USERNAME /home/$USERNAME/.syncthing-server-id
|
||||
fi
|
||||
|
@ -259,7 +259,7 @@ function user_devices_changed {
|
|||
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -f /home/$USERNAME/$SYNCTHING_UPDATE_FILE ]; then
|
||||
CHANGED=1
|
||||
fi
|
||||
|
|
|
@ -275,7 +275,7 @@ function set_user_permissions {
|
|||
echo $"Setting permissions"
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user $USERNAME) == "1" ]]; then
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
chown -R $USERNAME:$USERNAME /home/$USERNAME
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue