2024-04-09 04:25:51 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Automated script to update my non-primary systems
|
2024-04-14 20:10:46 +05:30
|
|
|
# config to be in sync with upstream git repo while
|
2024-04-09 04:25:51 +05:30
|
|
|
# preserving local edits to dotfiles via git stash
|
|
|
|
|
2024-04-14 20:10:46 +05:30
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
|
2024-04-09 04:25:51 +05:30
|
|
|
# Relax permissions temporarily so git can work
|
2024-04-14 20:10:46 +05:30
|
|
|
sudo $SCRIPT_DIR/soften.sh $SCRIPT_DIR;
|
2024-04-09 04:25:51 +05:30
|
|
|
|
|
|
|
# Stash local edits, pull changes, and re-apply local edits
|
2024-04-14 20:10:46 +05:30
|
|
|
pushd $SCRIPT_DIR &> /dev/null;
|
2024-04-09 04:25:51 +05:30
|
|
|
git stash;
|
|
|
|
git pull;
|
|
|
|
git stash apply;
|
2024-04-14 20:10:46 +05:30
|
|
|
popd &> /dev/null;
|
2024-04-09 04:25:51 +05:30
|
|
|
|
|
|
|
# Permissions for files that should be owned by root
|
2024-04-14 20:10:46 +05:30
|
|
|
sudo $SCRIPT_DIR/harden.sh $SCRIPT_DIR;
|