id
This commit is contained in:
parent
0b0bce29dd
commit
0050d26e12
3 changed files with 10 additions and 7 deletions
9
sh/id.sh
Normal file
9
sh/id.sh
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# id
|
||||||
|
|
||||||
|
# check if current user is root
|
||||||
|
#| id
|
||||||
|
rwx_id_root() {
|
||||||
|
local user_id
|
||||||
|
user_id="$(id -u)"
|
||||||
|
[ "${user_id}" -eq 0 ] || return 1
|
||||||
|
}
|
|
@ -230,7 +230,7 @@ ${RWX_TMUX_BORDER_BACKGROUND}#{?window_zoomed_flag,\
|
||||||
#/ tmux_setup
|
#/ tmux_setup
|
||||||
rwx_tmux_setup() {
|
rwx_tmux_setup() {
|
||||||
local file script space
|
local file script space
|
||||||
if rwx_root; then
|
if rwx_id_root; then
|
||||||
file="/etc/tmux.conf"
|
file="/etc/tmux.conf"
|
||||||
script="/etc/tmux.sh"
|
script="/etc/tmux.sh"
|
||||||
else
|
else
|
||||||
|
|
|
@ -35,12 +35,6 @@ rwx_remove() {
|
||||||
"${@}"
|
"${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
rwx_root() {
|
|
||||||
local user_id
|
|
||||||
user_id="$(id --user)"
|
|
||||||
[ "${user_id}" -eq 0 ] || return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
rwx_warn_wipe() {
|
rwx_warn_wipe() {
|
||||||
local tmp
|
local tmp
|
||||||
rwx_list_block
|
rwx_list_block
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue