-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsoften.sh
executable file
·38 lines (31 loc) · 1.06 KB
/
soften.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# This will soften the security of these dotfiles, allowing
# the default unpriveleged user with UID/GID of 1000 to edit ALL FILES
# in the dotfiles directory
# This mainly is just here to be used by some scripts
# Run this inside of ~/.dotfiles (or whatever directory you installed
# the dotfiles to)
# Run this as root!
# BTW, this assumes your user account has a UID/GID of 1000
# After running this, YOUR UNPRIVELEGED USER CAN MAKE EDITS TO
# IMPORTANT SYSTEM FILES WHICH MAY COMPROMISE THE SYSTEM AFTER
# RUNNING nixos-rebuild switch!
if [ "$#" = 1 ]; then
SCRIPT_DIR=$1;
else
# shellcheck disable=SC3028
# shellcheck disable=SC3054
# shellcheck disable=SC3020
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
fi
# shellcheck disable=SC2164
# shellcheck disable=SC3044
# shellcheck disable=SC2086
# shellcheck disable=SC3020
pushd $SCRIPT_DIR &> /dev/null;
sudo chown -R 1000:users .;
# shellcheck disable=SC2164
# shellcheck disable=SC3044
# shellcheck disable=SC2086
# shellcheck disable=SC3020
popd &> /dev/null;