Last active
November 20, 2018 18:25
-
-
Save bryant1410/93474806716eeff537257518842bcff1 to your computer and use it in GitHub Desktop.
This script is a workaround to refresh the snaps under a NFS /home directory with root_squash option (the default).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script is a workaround to refresh the snaps under a NFS /home directory with root_squash option (the default). | |
# Note that using no_root_squash is insecure. | |
# The bug was already filed: https://bugs.launchpad.net/snappy/+bug/1804281 | |
set -ex | |
BACKUP_DIR=/s # CREATE AND/OR CHANGE THIS. | |
# Because of NFS issues, sometimes moving fails to erase the source, so it's better to copy and then remove. | |
cp -r ~/snap "${BACKUP_DIR}/" | |
rm -rf ~/snap | |
ln -s "${BACKUP_DIR}/snap" ~/snap | |
sudo snap refresh | |
rm ~/snap | |
mv "${BACKUP_DIR}/snap" ~/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment