quotes with wildcard
This commit is contained in:
parent
6db3860710
commit
369a297a77
|
@ -132,7 +132,7 @@ mkdir "/home/$ADD_USERNAME/.gnupg"
|
|||
|
||||
chown -R "$ADD_USERNAME":"$ADD_USERNAME" "/home/$ADD_USERNAME/.gnupg"
|
||||
chmod 700 "/home/$ADD_USERNAME/.gnupg"
|
||||
chmod 600 "/home/$ADD_USERNAME/.gnupg/*"
|
||||
chmod 600 "/home/$ADD_USERNAME/.gnupg/"*
|
||||
|
||||
# Generate a GPG key
|
||||
{ echo 'Key-Type: eddsa';
|
||||
|
|
|
@ -154,9 +154,9 @@ function restore_local_dokuwiki {
|
|||
function_check restore_directory_from_usb
|
||||
restore_directory_from_usb ${temp_restore_dir} dokuwikidat
|
||||
if [ -d "${temp_restore_dir}/var/www/${DOKUWIKI_DOMAIN_NAME}/htdocs/data" ]; then
|
||||
cp -r "${temp_restore_dir}/var/www/${DOKUWIKI_DOMAIN_NAME}/htdocs/data/*" "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data"
|
||||
cp -r "${temp_restore_dir}/var/www/${DOKUWIKI_DOMAIN_NAME}/htdocs/data/"* "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data"
|
||||
else
|
||||
cp -r "${temp_restore_dir}/*" "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data"
|
||||
cp -r "${temp_restore_dir}/"* "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -219,7 +219,7 @@ function restore_remote_dokuwiki {
|
|||
temp_restore_dir=/root/tempdokuwikidat
|
||||
restore_directory_from_friend $temp_restore_dir dokuwikidat
|
||||
if [ -d "$temp_restore_dir/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data" ]; then
|
||||
cp -r "$temp_restore_dir/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data/*" "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data/"
|
||||
cp -r "$temp_restore_dir/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data/"* "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data/"
|
||||
else
|
||||
cp -r $temp_restore_dir/* "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/data/"
|
||||
fi
|
||||
|
@ -237,7 +237,7 @@ function restore_remote_dokuwiki {
|
|||
temp_restore_dir=/root/tempdokuwikiacl
|
||||
restore_directory_from_friend $temp_restore_dir dokuwikiacl
|
||||
if [ -d "$temp_restore_dir/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/lib/plugins/acl" ]; then
|
||||
cp -r "$temp_restore_dir/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/lib/plugins/acl/*" "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/lib/plugins/acl/"
|
||||
cp -r "$temp_restore_dir/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/lib/plugins/acl/"* "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/lib/plugins/acl/"
|
||||
else
|
||||
cp -r $temp_restore_dir/* "/var/www/$DOKUWIKI_DOMAIN_NAME/htdocs/lib/plugins/acl/"
|
||||
fi
|
||||
|
|
|
@ -87,7 +87,7 @@ function restore_local_emacs {
|
|||
if [ ! -d "/home/$USERNAME/.emacs.d" ]; then
|
||||
mkdir "/home/$USERNAME/.emacs.d"
|
||||
fi
|
||||
cp -r "$temp_restore_dir/*" "/home/$USERNAME/.emacs.d"
|
||||
cp -r "$temp_restore_dir/"* "/home/$USERNAME/.emacs.d"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -143,7 +143,7 @@ function restore_remote_emacs {
|
|||
if [ ! -d "/home/$USERNAME/.emacs.d" ]; then
|
||||
mkdir "/home/$USERNAME/.emacs.d"
|
||||
fi
|
||||
cp -r "$temp_restore_dir/*" "/home/$USERNAME/.emacs.d/*"
|
||||
cp -r "$temp_restore_dir/"* "/home/$USERNAME/.emacs.d/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
|
|
@ -258,7 +258,7 @@ function restore_local_friendica {
|
|||
mkdir -p "$friendica_dir/store/[data]/smarty3"
|
||||
fi
|
||||
chmod 1777 "$friendica_dir/store/[data]/smarty3"
|
||||
chown -R www-data:www-data "$friendica_dir/*"
|
||||
chown -R www-data:www-data "$friendica_dir/"*
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
rm -rf $temp_restore_dir
|
||||
fi
|
||||
|
@ -297,7 +297,7 @@ function restore_remote_friendica {
|
|||
mkdir -p "/var/www/${FRIENDICA_DOMAIN_NAME}/htdocs/store/[data]/smarty3"
|
||||
fi
|
||||
chmod 1777 "/var/www/${FRIENDICA_DOMAIN_NAME}/htdocs/store/[data]/smarty3"
|
||||
chown -R www-data:www-data "/var/www/${FRIENDICA_DOMAIN_NAME}/htdocs/*"
|
||||
chown -R www-data:www-data "/var/www/${FRIENDICA_DOMAIN_NAME}/htdocs/"*
|
||||
fi
|
||||
if [ -d /root/tempfriendica ]; then
|
||||
rm -rf /root/tempfriendica
|
||||
|
|
|
@ -260,7 +260,7 @@ function restore_local_ghost {
|
|||
restore_directory_from_usb $temp_restore_dir ghostcontent
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
if [ -d "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/content" ]; then
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/content/*" "/var/www/$GHOST_DOMAIN_NAME/htdocs/content/"
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/content/"* "/var/www/$GHOST_DOMAIN_NAME/htdocs/content/"
|
||||
else
|
||||
if [ ! -d "/var/www/$GHOST_DOMAIN_NAME/htdocs/content" ]; then
|
||||
mkdir "/var/www/$GHOST_DOMAIN_NAME/htdocs/content"
|
||||
|
@ -276,7 +276,7 @@ function restore_local_ghost {
|
|||
restore_directory_from_usb $temp_restore_dir ghostcurrent
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
if [ -d "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content" ]; then
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/*" "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/"
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/"* "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/"
|
||||
else
|
||||
if [ ! -d "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content" ]; then
|
||||
mkdir -p "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content"
|
||||
|
@ -335,7 +335,7 @@ function restore_remote_ghost {
|
|||
restore_directory_from_friend $temp_restore_dir ghostcontent
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
if [ -d "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/content" ]; then
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/content/*" "/var/www/$GHOST_DOMAIN_NAME/htdocs/content/"
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/content/"* "/var/www/$GHOST_DOMAIN_NAME/htdocs/content/"
|
||||
else
|
||||
if [ ! -d "/var/www/$GHOST_DOMAIN_NAME/htdocs/content" ]; then
|
||||
mkdir "/var/www/$GHOST_DOMAIN_NAME/htdocs/content"
|
||||
|
@ -351,7 +351,7 @@ function restore_remote_ghost {
|
|||
restore_directory_from_friend $temp_restore_dir ghostcurrent
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
if [ -d "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content" ]; then
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/*" "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/"
|
||||
cp -r "$temp_restore_dir/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/"* "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/"
|
||||
else
|
||||
if [ ! -d "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content" ]; then
|
||||
mkdir -p "/var/www/$GHOST_DOMAIN_NAME/htdocs/current/content"
|
||||
|
@ -441,7 +441,7 @@ function install_ghost {
|
|||
yarn install --no-emoji --no-progress
|
||||
yarn cache clean
|
||||
adduser --system --home="/var/www/${GHOST_DOMAIN_NAME}/htdocs/" --group ghost
|
||||
rm -rf "/var/www/$GHOST_DOMAIN_NAME/htdocs/*"
|
||||
rm -rf "/var/www/$GHOST_DOMAIN_NAME/htdocs/"*
|
||||
printf 'y' | ghost install ${GHOST_VERSION} --user ghost --db=sqlite3 --port ${GHOST_PORT} --verbose
|
||||
|
||||
if [ ! -d "/var/www/$GHOST_DOMAIN_NAME/htdocs/versions" ]; then
|
||||
|
|
|
@ -444,7 +444,7 @@ function restore_local_gnusocial {
|
|||
if [ ! -d "$gnusocial_dir/static" ]; then
|
||||
mkdir "$gnusocial_dir/static"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/static/*" "$gnusocial_dir/static/"
|
||||
cp -rp "$temp_restore_dir/static/"* "$gnusocial_dir/static/"
|
||||
fi
|
||||
chown www-data:www-data "$gnusocial_dir/config.php"
|
||||
chown -R www-data:www-data "$gnusocial_dir/static"
|
||||
|
@ -459,7 +459,7 @@ function restore_local_gnusocial {
|
|||
if [ ! -d "$gnusocial_dir/file" ]; then
|
||||
mkdir "$gnusocial_dir/file"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/*" "$gnusocial_dir/file"
|
||||
cp -rp "$temp_restore_dir/"* "$gnusocial_dir/file"
|
||||
fi
|
||||
chown -R www-data:www-data "$gnusocial_dir/file"
|
||||
rm -rf "$temp_restore_dir"
|
||||
|
@ -540,7 +540,7 @@ function restore_remote_gnusocial {
|
|||
if [ ! -d "$gnusocial_dir/static" ]; then
|
||||
mkdir "$gnusocial_dir/static"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/static/*" "$gnusocial_dir/static/"
|
||||
cp -rp "$temp_restore_dir/static/"* "$gnusocial_dir/static/"
|
||||
fi
|
||||
chown www-data:www-data "$gnusocial_dir/config.php"
|
||||
chown -R www-data:www-data "$gnusocial_dir/static"
|
||||
|
@ -555,7 +555,7 @@ function restore_remote_gnusocial {
|
|||
if [ ! -d "$gnusocial_dir/file" ]; then
|
||||
mkdir "$gnusocial_dir/file"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/*" "$gnusocial_dir/file/"
|
||||
cp -rp "$temp_restore_dir/"* "$gnusocial_dir/file/"
|
||||
fi
|
||||
chown -R www-data:www-data "$gnusocial_dir/file"
|
||||
rm -rf $temp_restore_dir
|
||||
|
|
|
@ -202,7 +202,7 @@ function upgrade_gogs {
|
|||
exit 37823
|
||||
fi
|
||||
rm -rf "/home/${GOGS_USERNAME:?}/"*
|
||||
cp -r "${INSTALL_DIR}/gogs/*" "/home/${GOGS_USERNAME}"
|
||||
cp -r "${INSTALL_DIR}/gogs/"* "/home/${GOGS_USERNAME}"
|
||||
if [ -f ${GOGS_FILE} ]; then
|
||||
rm ${GOGS_FILE}
|
||||
fi
|
||||
|
@ -273,9 +273,9 @@ function restore_local_gogs {
|
|||
mkdir -p $GOGS_CONFIG_PATH
|
||||
fi
|
||||
if [ -d "/root/tempgogs/home/${GOGS_USERNAME}/custom" ]; then
|
||||
cp -r "/root/tempgogs/home/${GOGS_USERNAME}/custom/*" "/home/${GOGS_USERNAME}/custom/"
|
||||
cp -r "/root/tempgogs/home/${GOGS_USERNAME}/custom/"* "/home/${GOGS_USERNAME}/custom/"
|
||||
else
|
||||
cp -r "/root/tempgogs/*" "/home/${GOGS_USERNAME}/custom/"
|
||||
cp -r "/root/tempgogs/"* "/home/${GOGS_USERNAME}/custom/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -292,9 +292,9 @@ function restore_local_gogs {
|
|||
mkdir "/home/${GOGS_USERNAME}/gogs-repositories"
|
||||
fi
|
||||
if [ -d "${temp_restore_dir}repos/home/${GOGS_USERNAME}/gogs-repositories" ]; then
|
||||
cp -r "${temp_restore_dir}repos/home/${GOGS_USERNAME}/gogs-repositories/*" "/home/${GOGS_USERNAME}/gogs-repositories/"
|
||||
cp -r "${temp_restore_dir}repos/home/${GOGS_USERNAME}/gogs-repositories/"* "/home/${GOGS_USERNAME}/gogs-repositories/"
|
||||
else
|
||||
cp -r "${temp_restore_dir}repos/*" "/home/${GOGS_USERNAME}/gogs-repositories/"
|
||||
cp -r "${temp_restore_dir}repos/"* "/home/${GOGS_USERNAME}/gogs-repositories/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -508,7 +508,7 @@ function install_gogs {
|
|||
exit 37823
|
||||
fi
|
||||
rm -rf "/home/${GOGS_USERNAME:?}/"*
|
||||
cp -r "${INSTALL_DIR}/gogs/*" "/home/${GOGS_USERNAME}"
|
||||
cp -r "${INSTALL_DIR}/gogs/"* "/home/${GOGS_USERNAME}"
|
||||
if [ -f ${GOGS_FILE} ]; then
|
||||
rm ${GOGS_FILE}
|
||||
fi
|
||||
|
|
|
@ -256,7 +256,7 @@ function restore_local_htmly {
|
|||
if [ ! -d "/var/www/${HTMLY_DOMAIN_NAME}/htdocs" ]; then
|
||||
mkdir "/var/www/${HTMLY_DOMAIN_NAME}/htdocs"
|
||||
fi
|
||||
cp -r "${temp_restore_dir}/*" "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/"
|
||||
cp -r "${temp_restore_dir}/"* "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -283,7 +283,7 @@ function restore_local_htmly {
|
|||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/uncategorized/post" ]; then
|
||||
mv "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/*.md" "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/uncategorized/post"
|
||||
mv "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/"*.md "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/uncategorized/post"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@ -331,7 +331,7 @@ function restore_remote_htmly {
|
|||
if [ ! -d "/var/www/${HTMLY_DOMAIN_NAME}/htdocs" ]; then
|
||||
mkdir "/var/www/${HTMLY_DOMAIN_NAME}/htdocs"
|
||||
fi
|
||||
cp -r "${temp_restore_dir}/*" "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/"
|
||||
cp -r "${temp_restore_dir}/"* "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2181
|
||||
|
@ -354,7 +354,7 @@ function restore_remote_htmly {
|
|||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if [ -d "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/uncategorized/post" ]; then
|
||||
mv "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/*.md" "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/uncategorized/post"
|
||||
mv "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/"*.md "/var/www/${HTMLY_DOMAIN_NAME}/htdocs/content/$USERNAME/htmly/uncategorized/post"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -220,7 +220,7 @@ function upgrade_hubzilla {
|
|||
git merge --abort
|
||||
git stash
|
||||
git pull
|
||||
cp -r "$HUBZILLA_PATH/redmatrix-themes1/*" "$HUBZILLA_PATH/view/theme/"
|
||||
cp -r "$HUBZILLA_PATH/redmatrix-themes1/"* "$HUBZILLA_PATH/view/theme/"
|
||||
chown -R www-data:www-data "$HUBZILLA_PATH"
|
||||
fi
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ function restore_local_hubzilla {
|
|||
mkdir -p "$hubzilla_dir/store/[data]/smarty3"
|
||||
fi
|
||||
chmod 1777 "$hubzilla_dir/store/[data]/smarty3"
|
||||
chown -R www-data:www-data "$hubzilla_dir/*"
|
||||
chown -R www-data:www-data "$hubzilla_dir/"*
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
rm -rf $temp_restore_dir
|
||||
fi
|
||||
|
@ -287,7 +287,7 @@ function restore_remote_hubzilla {
|
|||
mkdir -p "/var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3"
|
||||
fi
|
||||
chmod 1777 "/var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3"
|
||||
chown -R www-data:www-data "/var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/*"
|
||||
chown -R www-data:www-data "/var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/"*
|
||||
fi
|
||||
if [ -d /root/temphubzilla ]; then
|
||||
rm -rf /root/temphubzilla
|
||||
|
|
|
@ -236,7 +236,7 @@ function icecast_import_from_usb {
|
|||
dialog --title $"Import stream files from USB drive" --msgbox $'No stream files directory found on USB drive' 6 50
|
||||
backup_unmount_drive "${USB_DRIVE}"
|
||||
fi
|
||||
cp -ru "$USB_MOUNT$ICECAST_DIR/*" $ICECAST_DIR
|
||||
cp -ru "$USB_MOUNT$ICECAST_DIR/"* $ICECAST_DIR
|
||||
backup_unmount_drive "${USB_DRIVE}"
|
||||
icecast_convert_files $ICECAST_DIR
|
||||
dialog --title $"Import stream files from USB drive" --msgbox $'Import complete. You may now remove the USB drive' 6 50
|
||||
|
@ -255,7 +255,7 @@ function icecast_export_to_usb {
|
|||
if [ ! -d "$USB_MOUNT$ICECAST_DIR" ]; then
|
||||
mkdir -p "$USB_MOUNT$ICECAST_DIR"
|
||||
fi
|
||||
cp -ru "$ICECAST_DIR/*" "$USB_MOUNT$ICECAST_DIR"
|
||||
cp -ru "$ICECAST_DIR/"* "$USB_MOUNT$ICECAST_DIR"
|
||||
backup_unmount_drive "${USB_DRIVE}"
|
||||
dialog --title $"Export stream files to USB drive" --msgbox $'Export complete. You may now remove the USB drive' 6 50
|
||||
}
|
||||
|
|
|
@ -120,9 +120,9 @@ function restore_local_ipfs {
|
|||
restore_directory_from_usb $temp_restore_dir ipfs
|
||||
ADMIN_USERNAME=$(get_completion_param "Admin user")
|
||||
if [ -d "$temp_restore_dir/home/$ADMIN_USERNAME/.ipfs" ]; then
|
||||
cp -rf "$temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/*" "/home/$ADMIN_USERNAME/.ipfs"
|
||||
cp -rf "$temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/"* "/home/$ADMIN_USERNAME/.ipfs"
|
||||
else
|
||||
cp -rf "$temp_restore_dir/*" "/home/$ADMIN_USERNAME/.ipfs"
|
||||
cp -rf "$temp_restore_dir/"* "/home/$ADMIN_USERNAME/.ipfs"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -157,9 +157,9 @@ function restore_remote_ipfs {
|
|||
function_check restore_directory_from_friend
|
||||
restore_directory_from_friend $temp_restore_dir ipfs
|
||||
if [ -d "$temp_restore_dir/home/$ADMIN_USERNAME/.ipfs" ]; then
|
||||
cp -rf "$temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/*" "/home/$ADMIN_USERNAME/.ipfs"
|
||||
cp -rf "$temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/"* "/home/$ADMIN_USERNAME/.ipfs"
|
||||
else
|
||||
cp -rf "$temp_restore_dir/*" "/home/$ADMIN_USERNAME/.ipfs"
|
||||
cp -rf "$temp_restore_dir/"* "/home/$ADMIN_USERNAME/.ipfs"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
|
|
@ -262,7 +262,7 @@ function restore_local_kanboard {
|
|||
if [ ! -d "$kanboard_dir/data" ]; then
|
||||
mkdir "$kanboard_dir/data"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/*" "$kanboard_dir/data/"
|
||||
cp -rp "$temp_restore_dir/"* "$kanboard_dir/data/"
|
||||
fi
|
||||
chown -R www-data:www-data "$kanboard_dir/data"
|
||||
rm -rf $temp_restore_dir
|
||||
|
@ -343,7 +343,7 @@ function restore_remote_kanboard {
|
|||
if [ ! -d "$kanboard_dir/data" ]; then
|
||||
mkdir "$kanboard_dir/data"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/*" "$kanboard_dir/data/"
|
||||
cp -rp "$temp_restore_dir/"* "$kanboard_dir/data/"
|
||||
fi
|
||||
chown -R www-data:www-data "$kanboard_dir/data"
|
||||
rm -rf $temp_restore_dir
|
||||
|
|
|
@ -226,7 +226,7 @@ function koel_import_from_usb {
|
|||
dialog --title $"Import music from USB drive" --msgbox $'No Music directory found on USB drive' 6 50
|
||||
backup_unmount_drive "${USB_DRIVE}"
|
||||
fi
|
||||
cp -ru "$USB_MOUNT/Music/*" /music
|
||||
cp -ru "$USB_MOUNT/Music/"* /music
|
||||
backup_unmount_drive "${USB_DRIVE}"
|
||||
dialog --title $"Import music from USB drive" --msgbox $'Import complete. You may now remove the USB drive' 6 50
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ function upgrade_koel {
|
|||
cd "/var/www/${KOEL_DOMAIN_NAME}/htdocs" || exit 7345346358
|
||||
php artisan koel:init
|
||||
koel_remove_gravatar
|
||||
chown -R www-data:www-data "/var/www/${KOEL_DOMAIN_NAME}/htdocs/*"
|
||||
chown -R www-data:www-data "/var/www/${KOEL_DOMAIN_NAME}/htdocs/"*
|
||||
|
||||
systemctl start koel
|
||||
}
|
||||
|
|
|
@ -634,7 +634,7 @@ function install_home_server {
|
|||
fi
|
||||
rm -rf /usr/local/lib/python2.7/dist-packages/ldap*
|
||||
if [ -d "$INSTALL_DIR/matrix" ]; then
|
||||
rm -rf "$INSTALL_DIR/matrix/*"
|
||||
rm -rf "$INSTALL_DIR/matrix/"*
|
||||
fi
|
||||
if ! pip install --upgrade --process-dependency-links . -b "$INSTALL_DIR/matrix"; then
|
||||
echo $'Failed to install matrix home server'
|
||||
|
|
|
@ -230,9 +230,9 @@ function restore_remote_mediagoblin {
|
|||
function_check restore_directory_from_friend
|
||||
restore_directory_from_friend $temp_restore_dir mediagoblin
|
||||
if [ -d "${temp_restore_dir}$MEDIAGOBLIN_BASE_DIR" ]; then
|
||||
cp -r "${temp_restore_dir}$MEDIAGOBLIN_BASE_DIR/*" "$MEDIAGOBLIN_BASE_DIR/"
|
||||
cp -r "${temp_restore_dir}$MEDIAGOBLIN_BASE_DIR/"* "$MEDIAGOBLIN_BASE_DIR/"
|
||||
else
|
||||
cp -r "${temp_restore_dir}/*" "$MEDIAGOBLIN_BASE_DIR/"
|
||||
cp -r "${temp_restore_dir}/"* "$MEDIAGOBLIN_BASE_DIR/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
|
|
@ -71,7 +71,7 @@ function pihole_copy_files {
|
|||
if [ ! -f $PIHOLE_CUSTOM_ADLIST ]; then
|
||||
cp "$INSTALL_DIR/pihole/adlists.default" $PIHOLE_CUSTOM_ADLIST
|
||||
fi
|
||||
cp "$INSTALL_DIR/pihole/advanced/Scripts/*" /opt/$piholeBasename
|
||||
cp "$INSTALL_DIR/pihole/advanced/Scripts/"* /opt/$piholeBasename
|
||||
if [ -f /etc/dnsmasq.d/01-pihole.conf ]; then
|
||||
rm /etc/dnsmasq.d/01-pihole.conf
|
||||
fi
|
||||
|
|
|
@ -1099,7 +1099,7 @@ function install_pleroma {
|
|||
|
||||
# back end
|
||||
cd "$PLEROMA_DIR" || exit 246824684
|
||||
chown -R pleroma:pleroma "$PLEROMA_DIR/*"
|
||||
chown -R pleroma:pleroma "$PLEROMA_DIR/"*
|
||||
if ! sudo -u pleroma mix local.hex --force; then
|
||||
echo $'mix local.hex failed'
|
||||
exit 1745673
|
||||
|
|
|
@ -459,7 +459,7 @@ function restore_local_postactiv {
|
|||
if [ ! -d "$postactiv_dir/static" ]; then
|
||||
mkdir "$postactiv_dir/static"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/static/*" "$postactiv_dir/static/"
|
||||
cp -rp "$temp_restore_dir/static/"* "$postactiv_dir/static/"
|
||||
fi
|
||||
chown www-data:www-data "$postactiv_dir/config.php"
|
||||
chown -R www-data:www-data "$postactiv_dir/static"
|
||||
|
@ -474,7 +474,7 @@ function restore_local_postactiv {
|
|||
if [ ! -d "$postactiv_dir/file" ]; then
|
||||
mkdir "$postactiv_dir/file"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/*" "$postactiv_dir/file/"
|
||||
cp -rp "$temp_restore_dir/"* "$postactiv_dir/file/"
|
||||
fi
|
||||
chown -R www-data:www-data "$postactiv_dir/file"
|
||||
rm -rf $temp_restore_dir
|
||||
|
@ -555,7 +555,7 @@ function restore_remote_postactiv {
|
|||
if [ ! -d "$postactiv_dir/static" ]; then
|
||||
mkdir "$postactiv_dir/static"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/static/*" "$postactiv_dir/static/"
|
||||
cp -rp "$temp_restore_dir/static/"* "$postactiv_dir/static/"
|
||||
fi
|
||||
chown www-data:www-data "$postactiv_dir/config.php"
|
||||
chown -R www-data:www-data "$postactiv_dir/static"
|
||||
|
@ -570,7 +570,7 @@ function restore_remote_postactiv {
|
|||
if [ ! -d "$postactiv_dir/file" ]; then
|
||||
mkdir "$postactiv_dir/file"
|
||||
fi
|
||||
cp -rp "$temp_restore_dir/*" "$postactiv_dir/file/"
|
||||
cp -rp "$temp_restore_dir/"* "$postactiv_dir/file/"
|
||||
fi
|
||||
chown -R www-data:www-data "$postactiv_dir/file"
|
||||
rm -rf $temp_restore_dir
|
||||
|
|
|
@ -205,9 +205,9 @@ function restore_local_privatebin {
|
|||
restore_directory_from_usb $temp_restore_dir privatebin
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
if [ -d "$temp_restore_dir$privatebin_dir" ]; then
|
||||
cp -rp "$temp_restore_dir$privatebin_dir/*" "$privatebin_dir/"
|
||||
cp -rp "$temp_restore_dir$privatebin_dir/"* "$privatebin_dir/"
|
||||
else
|
||||
cp -rp "$temp_restore_dir/*" "$privatebin_dir/"
|
||||
cp -rp "$temp_restore_dir/"* "$privatebin_dir/"
|
||||
fi
|
||||
secure_privatebin
|
||||
rm -rf $temp_restore_dir
|
||||
|
@ -249,9 +249,9 @@ function restore_remote_privatebin {
|
|||
restore_directory_from_friend $temp_restore_dir privatebin
|
||||
if [ -d $temp_restore_dir ]; then
|
||||
if [ -d "$temp_restore_dir$privatebin_dir" ]; then
|
||||
cp -rp "$temp_restore_dir$privatebin_dir/*" "$privatebin_dir/"
|
||||
cp -rp "$temp_restore_dir$privatebin_dir/"* "$privatebin_dir/"
|
||||
else
|
||||
cp -rp "$temp_restore_dir/*" "$privatebin_dir/"
|
||||
cp -rp "$temp_restore_dir/"* "$privatebin_dir/"
|
||||
fi
|
||||
secure_privatebin
|
||||
rm -rf $temp_restore_dir
|
||||
|
|
|
@ -155,7 +155,7 @@ function riot_download {
|
|||
echo $'Unable to extract Riot Web tarball'
|
||||
exit 542826
|
||||
fi
|
||||
cp -r "$INSTALL_DIR/${RIOT_FILENAME}/*" "/var/www/$RIOT_DOMAIN_NAME/htdocs"
|
||||
cp -r "$INSTALL_DIR/${RIOT_FILENAME}/"* "/var/www/$RIOT_DOMAIN_NAME/htdocs"
|
||||
|
||||
chown -R www-data:www-data "/var/www/$RIOT_DOMAIN_NAME/htdocs"
|
||||
}
|
||||
|
|
|
@ -346,7 +346,7 @@ function restore_local_syncthing {
|
|||
cp -r /root/Sync/* "/home/$USERNAME/Sync/"
|
||||
rm -rf /root/Sync
|
||||
else
|
||||
cp -r "${temp_restore_dir}/*" "/home/$USERNAME/Sync/"
|
||||
cp -r "${temp_restore_dir}/"* "/home/$USERNAME/Sync/"
|
||||
fi
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
|
@ -473,7 +473,7 @@ function restore_remote_syncthing {
|
|||
cp -r /root/Sync/* "/home/$USERNAME/Sync/"
|
||||
rm -rf /root/Sync
|
||||
else
|
||||
cp -r "${temp_restore_dir}/*" "/home/$USERNAME/Sync/"
|
||||
cp -r "${temp_restore_dir}/"* "/home/$USERNAME/Sync/"
|
||||
fi
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
|
|
|
@ -76,10 +76,10 @@ function remove_user_tox {
|
|||
|
||||
if [ -d "/home/$remove_username/.config/tox" ]; then
|
||||
if [ -d "/home/$remove_username/.config/tox/chatlogs" ]; then
|
||||
shred -zu "/home/$remove_username/.config/tox/chatlogs/*"
|
||||
shred -zu "/home/$remove_username/.config/tox/chatlogs/"*
|
||||
rm -rf "/home/$remove_username/.config/tox/chatlogs"
|
||||
fi
|
||||
shred -zu "/home/$remove_username/.config/tox/*"
|
||||
shred -zu "/home/$remove_username/.config/tox/"*
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ function restore_local_vim {
|
|||
if [ ! -d "/home/$USERNAME/$VIM_TEMP_DIR" ]; then
|
||||
mkdir "/home/$USERNAME/$VIM_TEMP_DIR"
|
||||
fi
|
||||
cp -r "$temp_restore_dir/*" "/home/$USERNAME/$VIM_TEMP_DIR/"
|
||||
cp -r "$temp_restore_dir/"* "/home/$USERNAME/$VIM_TEMP_DIR/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -117,7 +117,7 @@ function restore_local_vim {
|
|||
backup_unmount_drive
|
||||
exit 664
|
||||
fi
|
||||
cp "/home/$USERNAME/$VIM_TEMP_DIR/*" "/home/$USERNAME"
|
||||
cp "/home/$USERNAME/$VIM_TEMP_DIR/"* "/home/$USERNAME"
|
||||
if [ -f "/home/$USERNAME/.viminfo" ]; then
|
||||
chown "$USERNAME":"$USERNAME" "/home/$USERNAME/.viminfo"
|
||||
fi
|
||||
|
@ -182,7 +182,7 @@ function restore_remote_vim {
|
|||
if [ ! -d "/home/$USERNAME/$VIM_TEMP_DIR" ]; then
|
||||
mkdir "/home/$USERNAME/$VIM_TEMP_DIR"
|
||||
fi
|
||||
cp -r "$temp_restore_dir/*" "/home/$USERNAME/$VIM_TEMP_DIR/"
|
||||
cp -r "$temp_restore_dir/"* "/home/$USERNAME/$VIM_TEMP_DIR/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -193,7 +193,7 @@ function restore_remote_vim {
|
|||
backup_unmount_drive
|
||||
exit 664
|
||||
fi
|
||||
cp "/home/$USERNAME/$VIM_TEMP_DIR/*" "/home/$USERNAME"
|
||||
cp "/home/$USERNAME/$VIM_TEMP_DIR/"* "/home/$USERNAME"
|
||||
if [ -f "/home/$USERNAME/.viminfo" ]; then
|
||||
chown "$USERNAME":"$USERNAME" "/home/$USERNAME/.viminfo"
|
||||
fi
|
||||
|
|
|
@ -380,8 +380,8 @@ function update_prosody_modules {
|
|||
if [ ! -d /var/lib/prosody/prosody-modules ]; then
|
||||
mkdir -p /var/lib/prosody/prosody-modules
|
||||
fi
|
||||
cp -r "$INSTALL_DIR/prosody-modules/*" /var/lib/prosody/prosody-modules/
|
||||
cp -r "$INSTALL_DIR/prosody-modules/*" /usr/lib/prosody/modules/
|
||||
cp -r "$INSTALL_DIR/prosody-modules/"* /var/lib/prosody/prosody-modules/
|
||||
cp -r "$INSTALL_DIR/prosody-modules/"* /usr/lib/prosody/modules/
|
||||
chown -R prosody:prosody /var/lib/prosody/prosody-modules
|
||||
chown -R prosody:prosody /usr/lib/prosody/modules
|
||||
systemctl start prosody
|
||||
|
@ -505,7 +505,7 @@ function upgrade_xmpp {
|
|||
set_completion_param "prosody_filename" "${prosody_filename}"
|
||||
fi
|
||||
|
||||
cp -r "$INSTALL_DIR/prosody-modules/*" /var/lib/prosody/prosody-modules/
|
||||
cp -r "$INSTALL_DIR/prosody-modules/"* /var/lib/prosody/prosody-modules/
|
||||
chown -R prosody:prosody /var/lib/prosody/prosody-modules
|
||||
|
||||
systemctl restart prosody
|
||||
|
|
|
@ -203,7 +203,7 @@ function install_zeronet_blog {
|
|||
|
||||
echo $"ZeroNet Blog address: $ZERONET_BLOG_ADDRESS"
|
||||
echo $"ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY"
|
||||
cp -r "$MESH_INSTALL_DIR/zeronet/ZeroBlog/*" "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS"
|
||||
cp -r "$MESH_INSTALL_DIR/zeronet/ZeroBlog/"* "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS"
|
||||
|
||||
if [ ! -d "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data" ]; then
|
||||
mkdir "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_BLOG_ADDRESS/data"
|
||||
|
@ -286,7 +286,7 @@ function install_zeronet_mail {
|
|||
|
||||
echo $"ZeroNet Mail address: $ZERONET_MAIL_ADDRESS"
|
||||
echo $"ZeroNet Mail private key: $ZERONET_MAIL_PRIVATE_KEY"
|
||||
cp -r "$MESH_INSTALL_DIR/zeronet/ZeroMail/*" "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS"
|
||||
cp -r "$MESH_INSTALL_DIR/zeronet/ZeroMail/"* "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS"
|
||||
|
||||
if [ ! -d "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data" ]; then
|
||||
mkdir "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_MAIL_ADDRESS/data"
|
||||
|
@ -368,7 +368,7 @@ function install_zeronet_forum {
|
|||
|
||||
echo $"Forum address: $ZERONET_FORUM_ADDRESS"
|
||||
echo $"Forum private key: $ZERONET_FORUM_PRIVATE_KEY"
|
||||
cp -r "$MESH_INSTALL_DIR/zeronet/ZeroTalk/*" "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS"
|
||||
cp -r "$MESH_INSTALL_DIR/zeronet/ZeroTalk/"* "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS"
|
||||
sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html"
|
||||
sed -i "s/ZeroTalk/$ZERONET_DEFAULT_FORUM_TITLE/g" "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html"
|
||||
sed -i "s|Demo for dynamic, decentralized content publishing.|$ZERONET_DEFAULT_FORUM_TAGLINE|g" "$MESH_INSTALL_DIR/zeronet/data/$ZERONET_FORUM_ADDRESS/index.html"
|
||||
|
|
|
@ -421,7 +421,7 @@ function disperse_key_shares {
|
|||
fi
|
||||
|
||||
# remove the temp file/directory
|
||||
shred -zu "$temp_key_share_fragments/*"
|
||||
shred -zu "$temp_key_share_fragments/"*
|
||||
rm -rf "$temp_key_share_dir"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -1330,7 +1330,7 @@ function configure_gpg {
|
|||
else
|
||||
chown -R "$MY_USERNAME":"$MY_USERNAME" "$gpg_dir"
|
||||
chmod 700 "$gpg_dir"
|
||||
chmod 600 "$gpg_dir/*"
|
||||
chmod 600 "$gpg_dir/"*
|
||||
printf '%%Assuan%%\nsocket=/dev/shm/S.dirmngr\n' > "/home/$MY_USERNAME/.gnupg/S.dirmngr"
|
||||
if [ -d "/home/$MY_USERNAME/.gnupg/crls.d" ]; then
|
||||
chmod +x "/home/$MY_USERNAME/.gnupg/crls.d"
|
||||
|
@ -1362,7 +1362,7 @@ function configure_gpg {
|
|||
|
||||
chown -R "$MY_USERNAME":"$MY_USERNAME" "$gpg_dir"
|
||||
chmod 700 "$gpg_dir"
|
||||
chmod 600 "$gpg_dir/*"
|
||||
chmod 600 "$gpg_dir/"*
|
||||
printf '%%Assuan%%\nsocket=/dev/shm/S.dirmngr\n' > "$gpg_dir/S.dirmngr"
|
||||
if [ -d "$gpg_dir/crls.d" ]; then
|
||||
chmod +x "$gpg_dir/crls.d"
|
||||
|
|
|
@ -2153,7 +2153,7 @@ function add_clacks {
|
|||
clacks=$(<"$data")
|
||||
if [ ${#clacks} -gt 1 ]; then
|
||||
|
||||
WEB_FILES="/etc/nginx/sites-available/*"
|
||||
WEB_FILES="/etc/nginx/sites-available/"*
|
||||
for f in $WEB_FILES
|
||||
do
|
||||
if grep -q "X-Clacks-Overhead" "$f"; then
|
||||
|
|
|
@ -1809,7 +1809,7 @@ function image_setup_utils {
|
|||
echo "export PATH=\$PATH:\$GOPATH" >> "${rootdir}/etc/skel/.bashrc"
|
||||
echo "export PATH=\$PATH:\$GOPATH" >> "${rootdir}/home/go/.bashrc"
|
||||
chroot "$rootdir" chown -R go:go /home/go
|
||||
cp "${rootdir}/home/go/go${GO_VERSION}/bin/*" "${rootdir}/usr/bin"
|
||||
cp "${rootdir}/home/go/go${GO_VERSION}/bin/"* "${rootdir}/usr/bin"
|
||||
|
||||
# Tomb
|
||||
chroot "$rootdir" apt-get -yq install zsh pinentry-curses
|
||||
|
|
|
@ -207,7 +207,7 @@ EOF
|
|||
|
||||
# Copy all DTBs
|
||||
mkdir -p /boot/dtbs
|
||||
cp "/usr/lib/$kernelVersion/*" /boot/dtbs
|
||||
cp "/usr/lib/$kernelVersion/"* /boot/dtbs
|
||||
|
||||
# extra boot modules
|
||||
echo "rtc_sunxi" >> /etc/initramfs-tools/modules
|
||||
|
|
|
@ -843,7 +843,7 @@ function show_desktop_icons {
|
|||
|
||||
# set permissions
|
||||
chmod +x "/home/$MY_USERNAME/Desktop/*.desktop"
|
||||
chown "${MY_USERNAME}":"${MY_USERNAME}" "/home/$MY_USERNAME/Desktop/*"
|
||||
chown "${MY_USERNAME}":"${MY_USERNAME}" "/home/$MY_USERNAME/Desktop/"*
|
||||
chown "${MY_USERNAME}":"${MY_USERNAME}" "/home/$MY_USERNAME/.config"
|
||||
chown -R "${MY_USERNAME}":"${MY_USERNAME}" "/home/$MY_USERNAME/.config/tox"
|
||||
chown -R "${MY_USERNAME}":"${MY_USERNAME}" "/home/$MY_USERNAME/.config/autostart"
|
||||
|
|
|
@ -141,7 +141,7 @@ function clear_passwords {
|
|||
for d in /root/.passwords/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $4}')
|
||||
if [[ "$USERNAME" != 'root' ]]; then
|
||||
shred -zu "/root/.passwords/$USERNAME/*"
|
||||
shred -zu "/root/.passwords/$USERNAME/"*
|
||||
rm -rf "/root/.passwords/$USERNAME"
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -123,7 +123,7 @@ if [ "$FRIENDS_SERVERS_LIST" ]; then
|
|||
|
||||
echo -n $"Starting key retrieval from $REMOTE_SERVER..."
|
||||
/usr/bin/sshpass -p "$REMOTE_PASSWORD" \
|
||||
scp -r -P "$REMOTE_SSH_PORT" "$REMOTE_SERVER/.gnupg_fragments/*" "/home/$MY_USERNAME/.gnupg_fragments"
|
||||
scp -r -P "$REMOTE_SSH_PORT" "$REMOTE_SERVER/.gnupg_fragments/"* "/home/$MY_USERNAME/.gnupg_fragments"
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
echo $'FAILED'
|
||||
|
|
|
@ -561,7 +561,7 @@ function restore_spamassassin {
|
|||
if [ ! -d "/home/$USERNAME/.spamassassin" ]; then
|
||||
mkdir "/home/$USERNAME/.spamassassin"
|
||||
fi
|
||||
cp -rf "$temp_restore_dir/*" "/home/$USERNAME/.spamassassin/"
|
||||
cp -rf "$temp_restore_dir/"* "/home/$USERNAME/.spamassassin/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -634,7 +634,7 @@ function restore_user_ssh_keys {
|
|||
if [ ! -d "/home/$USERNAME/.ssh" ]; then
|
||||
mkdir "/home/$USERNAME/.ssh"
|
||||
fi
|
||||
cp -r "$temp_restore_dir/*" "/home/$USERNAME/.ssh/"
|
||||
cp -r "$temp_restore_dir/"* "/home/$USERNAME/.ssh/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -753,7 +753,7 @@ function restore_user_fin {
|
|||
if [ ! -d "/home/$USERNAME/.fin" ]; then
|
||||
mkdir "/home/$USERNAME/.fin"
|
||||
fi
|
||||
cp -r "$temp_restore_dir/*" "/home/$USERNAME/.fin/"
|
||||
cp -r "$temp_restore_dir/"* "/home/$USERNAME/.fin/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
|
|
@ -432,7 +432,7 @@ function restore_gpg {
|
|||
if [ ! -d "/home/$USERNAME/.gnupg" ]; then
|
||||
mkdir "/home/$USERNAME/.gnupg"
|
||||
fi
|
||||
cp -r "${temp_restore_dir}/*" "/home/$USERNAME/.gnupg/"
|
||||
cp -r "${temp_restore_dir}/"* "/home/$USERNAME/.gnupg/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -599,7 +599,7 @@ function restore_user_config {
|
|||
if [ ! -d "/home/$USERNAME/.config" ]; then
|
||||
mkdir "/home/$USERNAME/.config"
|
||||
fi
|
||||
cp -r "$temp_restore_dir/*" "/home/$USERNAME/.config/"
|
||||
cp -r "$temp_restore_dir/"* "/home/$USERNAME/.config/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
|
|
@ -113,12 +113,12 @@ fi
|
|||
|
||||
# remove gpg keys
|
||||
if [ -d "/home/$REMOVE_USERNAME/.gnupg" ]; then
|
||||
shred -zu "/home/$REMOVE_USERNAME/.gnupg/*"
|
||||
shred -zu "/home/$REMOVE_USERNAME/.gnupg/"*
|
||||
fi
|
||||
|
||||
# remove ssh keys
|
||||
if [ -d "/home/$REMOVE_USERNAME/.ssh" ]; then
|
||||
shred -zu "/home/$REMOVE_USERNAME/.ssh/*"
|
||||
shred -zu "/home/$REMOVE_USERNAME/.ssh/"*
|
||||
fi
|
||||
|
||||
echo $'Detecting installed apps...'
|
||||
|
|
|
@ -75,7 +75,7 @@ fi
|
|||
if [ -d "$PROJECT_DIR" ]; then
|
||||
if [ -f "$CONFIGURATION_FILE" ]; then
|
||||
cd "$PROJECT_DIR" || exit 246823484
|
||||
rm -rf "$PROJECT_DIR/locale/*"
|
||||
rm -rf "$PROJECT_DIR/locale/"*
|
||||
if [[ "$CURRENT_BRANCH" == *"master" ]]; then
|
||||
git_pull $PROJECT_REPO
|
||||
else
|
||||
|
|
|
@ -260,7 +260,7 @@ function backup_database_local_usb {
|
|||
if [ -f "${local_database_dir}/${1}.${database_file_extension}" ]; then
|
||||
if [ ! -s "${local_database_dir}/${1}.${database_file_extension}" ]; then
|
||||
echo $"${1} database could not be saved"
|
||||
shred -zu "${local_database_dir}/*"
|
||||
shred -zu "${local_database_dir}/"*
|
||||
rm -rf "${local_database_dir}"
|
||||
umount "$USB_MOUNT"
|
||||
rm -rf "$USB_MOUNT"
|
||||
|
@ -286,7 +286,7 @@ function backup_directory_to_usb_duplicity {
|
|||
umount "$USB_MOUNT"
|
||||
rm -rf "$USB_MOUNT"
|
||||
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
||||
shred -zu "${1}/*"
|
||||
shred -zu "${1}/"*
|
||||
rm -rf "${1}"
|
||||
fi
|
||||
function_check restart_site
|
||||
|
@ -301,7 +301,7 @@ function backup_directory_to_usb_duplicity {
|
|||
umount "$USB_MOUNT"
|
||||
rm -rf "$USB_MOUNT"
|
||||
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
||||
shred -zu "${1}/*"
|
||||
shred -zu "${1}/"*
|
||||
rm -rf "${1}"
|
||||
fi
|
||||
function_check restart_site
|
||||
|
@ -334,7 +334,7 @@ function backup_directory_to_usb {
|
|||
backup_directory_to_usb_duplicity "${1}" "${2}"
|
||||
|
||||
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
||||
shred -zu "${1}/*"
|
||||
shred -zu "${1}/"*
|
||||
rm -rf "${1}"
|
||||
fi
|
||||
fi
|
||||
|
@ -416,7 +416,7 @@ function backup_directory_to_friend_duplicity {
|
|||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
if [[ "${1}" == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
||||
shred -zu "${1}/*"
|
||||
shred -zu "${1}/"*
|
||||
rm -rf "${1}"
|
||||
fi
|
||||
function_check restart_site
|
||||
|
@ -429,7 +429,7 @@ function backup_directory_to_friend_duplicity {
|
|||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
if [[ "${1}" == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
||||
shred -zu "${1}/*"
|
||||
shred -zu "${1}/"*
|
||||
rm -rf "${1}"
|
||||
fi
|
||||
function_check restart_site
|
||||
|
@ -459,7 +459,7 @@ function backup_directory_to_friend {
|
|||
backup_directory_to_friend_duplicity "${1}" "${2}"
|
||||
|
||||
if [[ "${1}" == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
||||
shred -zu "/root/temp${2}/*"
|
||||
shred -zu "/root/temp${2}/"*
|
||||
rm -rf "/root/temp${2}"
|
||||
fi
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ function backup_database_remote {
|
|||
if [ -f "${local_database_dir}/${1}.${database_file_extension}" ]; then
|
||||
if [ ! -s "${local_database_dir}/${1}.${database_file_extension}" ]; then
|
||||
echo $"${1} database could not be saved"
|
||||
shred -zu "${local_database_dir}/*"
|
||||
shred -zu "${local_database_dir}/"*
|
||||
rm -rf "${local_database_dir}"
|
||||
# Send a warning email
|
||||
echo $"Unable to export ${1} database" | mail -s $"${PROJECT_NAME} backup to friends" "$ADMIN_EMAIL_ADDRESS"
|
||||
|
@ -629,7 +629,7 @@ function restore_database_from_friend {
|
|||
exit 8735271
|
||||
fi
|
||||
if [ -d "${local_database_dir}/${RESTORE_SUBDIR}/temp${1}data" ]; then
|
||||
shred -zu "${local_database_dir}/${RESTORE_SUBDIR}/temp${1}data/*"
|
||||
shred -zu "${local_database_dir}/${RESTORE_SUBDIR}/temp${1}data/"*
|
||||
else
|
||||
shred -zu "${local_database_dir}/*.${database_file_extension}"
|
||||
fi
|
||||
|
@ -655,7 +655,7 @@ function restore_database_from_friend {
|
|||
rm -rf "/var/www/${2}/htdocs"
|
||||
mv "$restore_from_dir" "/var/www/${2}/"
|
||||
else
|
||||
cp -r "$restore_from_dir/*" "/var/www/${2}/htdocs/"
|
||||
cp -r "$restore_from_dir/"* "/var/www/${2}/htdocs/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -738,7 +738,7 @@ function restore_database {
|
|||
exit 482638995
|
||||
fi
|
||||
if [ -d "${local_database_dir}/${RESTORE_SUBDIR}/temp${restore_app_name}data" ]; then
|
||||
shred -zu "${local_database_dir}/${RESTORE_SUBDIR}/temp${restore_app_name}data/*"
|
||||
shred -zu "${local_database_dir}/${RESTORE_SUBDIR}/temp${restore_app_name}data/"*
|
||||
else
|
||||
shred -zu "${local_database_dir}/*.${database_file_extension}"
|
||||
fi
|
||||
|
@ -768,7 +768,7 @@ function restore_database {
|
|||
rm -rf "/var/www/${restore_app_domain}/htdocs"
|
||||
mv "$restore_from_dir" "/var/www/${restore_app_domain}/"
|
||||
else
|
||||
cp -r "$restore_from_dir/*" "/var/www/${restore_app_domain}/htdocs/"
|
||||
cp -r "$restore_from_dir/"* "/var/www/${restore_app_domain}/htdocs/"
|
||||
fi
|
||||
# shellcheck disable=SC2181
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
|
|
@ -342,7 +342,7 @@ function install_pleroma_front_end {
|
|||
npm install -g whatwg-fetch@2.0.3
|
||||
yarn
|
||||
if [ -f "$INSTALL_DIR/pleroma/dist/index.html" ]; then
|
||||
rm -rf "$INSTALL_DIR/pleroma/dist/*"
|
||||
rm -rf "$INSTALL_DIR/pleroma/dist/"*
|
||||
fi
|
||||
npm run build
|
||||
if [ ! -d "$INSTALL_DIR/pleroma/dist" ]; then
|
||||
|
@ -355,10 +355,10 @@ function install_pleroma_front_end {
|
|||
fi
|
||||
|
||||
if [[ "$app_name" != 'pleroma' ]]; then
|
||||
cp -r "$INSTALL_DIR/pleroma/dist/*" "/var/www/${pleroma_domain}/htdocs/"
|
||||
cp -r "$INSTALL_DIR/pleroma/dist/"* "/var/www/${pleroma_domain}/htdocs/"
|
||||
pleroma_set_background_image_from_url "/var/www/${pleroma_domain}/htdocs" "$pleroma_domain" "$background_url" "$title"
|
||||
else
|
||||
cp -r "$INSTALL_DIR/pleroma/dist/*" "$PLEROMA_DIR/priv/static"
|
||||
cp -r "$INSTALL_DIR/pleroma/dist/"* "$PLEROMA_DIR/priv/static"
|
||||
pleroma_set_background_image_from_url "$PLEROMA_DIR/priv/static" "$pleroma_domain" "$background_url" "$title"
|
||||
fi
|
||||
|
||||
|
@ -412,7 +412,7 @@ function upgrade_pleroma_frontend {
|
|||
if [ -f "$basedir/static/config.json" ]; then
|
||||
cp "$basedir/static/config.json" "$basedir/static/config.json.old"
|
||||
fi
|
||||
cp -r "$INSTALL_DIR/pleroma/dist/*" "$basedir/"
|
||||
cp -r "$INSTALL_DIR/pleroma/dist/"* "$basedir/"
|
||||
if [ -f "$basedir/static/config.json.old" ]; then
|
||||
mv "$basedir/static/config.json.old" "$basedir/static/config.json"
|
||||
fi
|
||||
|
|
|
@ -143,7 +143,7 @@ function gpg_set_permissions {
|
|||
|
||||
if [[ "$key_username" != 'root' ]]; then
|
||||
chmod 700 "/home/$key_username/.gnupg"
|
||||
chmod -R 600 "/home/$key_username/.gnupg/*"
|
||||
chmod -R 600 "/home/$key_username/.gnupg/"*
|
||||
printf '%%Assuan%%\nsocket=/dev/shm/S.dirmngr\n' > "/home/$key_username/.gnupg/S.dirmngr"
|
||||
if [ -d "/home/$key_username/.gnupg/crls.d" ]; then
|
||||
chmod +x "/home/$key_username/.gnupg/crls.d"
|
||||
|
|
|
@ -85,7 +85,7 @@ function interactive_gpg_from_usb {
|
|||
mkdir /etc/letsencrypt
|
||||
fi
|
||||
echo $'Recovering LetsEncrypt keys'
|
||||
cp -r "$USB_MOUNT/letsencrypt/*" /etc/letsencrypt
|
||||
cp -r "$USB_MOUNT/letsencrypt/"* /etc/letsencrypt
|
||||
addgroup ssl-cert
|
||||
chown -R root:ssl-cert /etc/letsencrypt
|
||||
fi
|
||||
|
@ -121,7 +121,7 @@ function interactive_gpg_from_usb {
|
|||
fi
|
||||
cp -r "$HOME_DIR/.gnupg $HOME_DIR/.gnupg_old"
|
||||
chmod 700 "$HOME_DIR/.gnupg_old"
|
||||
chmod -R 600 "$HOME_DIR/.gnupg_old/*"
|
||||
chmod -R 600 "$HOME_DIR/.gnupg_old/"*
|
||||
chown -R "$MY_USERNAME":"$MY_USERNAME" "$HOME_DIR/.gnupg_old"
|
||||
fi
|
||||
echo $'Removing old gpg keys'
|
||||
|
@ -145,7 +145,7 @@ function interactive_gpg_from_usb {
|
|||
mkdir "$HOME_DIR/.gnupg"
|
||||
fi
|
||||
echo $'Recovering GPG keys'
|
||||
cp -r "$USB_MOUNT/.gnupg/*" "$HOME_DIR/.gnupg"
|
||||
cp -r "$USB_MOUNT/.gnupg/"* "$HOME_DIR/.gnupg"
|
||||
GPG_LOADING="no"
|
||||
dialog --title $"Recover Encryption Keys" \
|
||||
--msgbox $"GPG Keyring directory loaded to $HOME_DIR" 6 70
|
||||
|
@ -154,7 +154,7 @@ function interactive_gpg_from_usb {
|
|||
if [ ! -d "$HOME_DIR/.gnupg_fragments" ]; then
|
||||
mkdir "$HOME_DIR/.gnupg_fragments"
|
||||
fi
|
||||
cp -r "$USB_MOUNT/.gnupg_fragments/*" "$HOME_DIR/.gnupg_fragments"
|
||||
cp -r "$USB_MOUNT/.gnupg_fragments/"* "$HOME_DIR/.gnupg_fragments"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -163,7 +163,7 @@ function interactive_gpg_from_usb {
|
|||
if [ ! -d "$HOME_DIR/.ssh" ]; then
|
||||
mkdir "$HOME_DIR/.ssh"
|
||||
fi
|
||||
cp "$USB_MOUNT/.ssh/*" "$HOME_DIR/.ssh"
|
||||
cp "$USB_MOUNT/.ssh/"* "$HOME_DIR/.ssh"
|
||||
dialog --title $"Recover Encryption Keys" \
|
||||
--msgbox $"ssh keys imported" 6 70
|
||||
SSH_IMPORTED="yes"
|
||||
|
|
|
@ -97,11 +97,11 @@ function remove_onion_service {
|
|||
fi
|
||||
fi
|
||||
if [ -d "${HIDDEN_SERVICE_PATH}${onion_service_name}" ]; then
|
||||
shred -zu "${HIDDEN_SERVICE_PATH}${onion_service_name}/*"
|
||||
shred -zu "${HIDDEN_SERVICE_PATH}${onion_service_name}/"*
|
||||
rm -rf "${HIDDEN_SERVICE_PATH}${onion_service_name}"
|
||||
fi
|
||||
if [ -d "${HIDDEN_SERVICE_PATH}${onion_service_name}_mobile" ]; then
|
||||
shred -zu "${HIDDEN_SERVICE_PATH}${onion_service_name}_mobile/*"
|
||||
shred -zu "${HIDDEN_SERVICE_PATH}${onion_service_name}_mobile/"*
|
||||
rm -rf "${HIDDEN_SERVICE_PATH}${onion_service_name}_mobile"
|
||||
fi
|
||||
remove_completion_param "${onion_service_name} onion domain"
|
||||
|
|
|
@ -817,8 +817,8 @@ function update_default_domain {
|
|||
chmod -R 700 /etc/prosody/certs/*
|
||||
chmod 600 /etc/prosody/prosody.cfg.lua
|
||||
if [ -d "$INSTALL_DIR/prosody-modules" ]; then
|
||||
cp -r "$INSTALL_DIR/prosody-modules/*" /var/lib/prosody/prosody-modules/
|
||||
cp -r "$INSTALL_DIR/prosody-modules/*" /usr/lib/prosody/modules/
|
||||
cp -r "$INSTALL_DIR/prosody-modules/"* /var/lib/prosody/prosody-modules/
|
||||
cp -r "$INSTALL_DIR/prosody-modules/"* /usr/lib/prosody/modules/
|
||||
fi
|
||||
chown -R prosody:prosody /var/lib/prosody/prosody-modules
|
||||
chown -R prosody:prosody /usr/lib/prosody/modules
|
||||
|
|
Loading…
Reference in New Issue