mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
7d09218524
* version change * Nova * No-config function * Markdown cleanup * Create gs-core file * correct missing includes via cron Co-authored-by: Michael Stanclift <vmstan@Sovereign.vmstan.net> Co-authored-by: Michael Stanclift <vmstan@sovereign.local>
42 lines
993 B
Bash
42 lines
993 B
Bash
# GRAVITY SYNC BY VMSTAN #####################
|
|
# gs-root.sh #################################
|
|
|
|
# For documentation or downloading updates visit https://github.com/vmstan/gravity-sync
|
|
# This code is called from the main gravity-sync.sh file and should not execute directly!
|
|
|
|
## Sudo Creation Task
|
|
function task_sudo {
|
|
TASKTYPE='SUDO'
|
|
MESSAGE="${MESSAGE}: ${TASKTYPE} Requested"
|
|
echo_good
|
|
|
|
MESSAGE="Creating Sudoer.d Template"
|
|
echo_stat
|
|
|
|
NEW_SUDO_USER=$(whoami)
|
|
echo -e "${NEW_SUDO_USER} ALL=(ALL) NOPASSWD: ALL" > $HOME/${LOCAL_FOLDR}/templates/gs-nopasswd.sudo
|
|
error_validate
|
|
|
|
MESSAGE="Installing Sudoer.d File"
|
|
echo_stat
|
|
|
|
sudo install -m 0440 $HOME/${LOCAL_FOLDR}/templates/gs-nopasswd.sudo /etc/sudoers.d/gs-nopasswd
|
|
error_validate
|
|
|
|
exit_withchange
|
|
}
|
|
|
|
## Root Check
|
|
function root_check {
|
|
if [ ! "$EUID" -ne 0 ]
|
|
then
|
|
TASKTYPE='ROOT'
|
|
MESSAGE="${MESSAGE} ${TASKTYPE}"
|
|
echo_fail
|
|
|
|
MESSAGE="${PROGRAM} Should Not Run As 'root'"
|
|
echo_warn
|
|
|
|
exit_nochange
|
|
fi
|
|
} |