Compare commits
2 Commits
eca4eeb42e
...
fa7205481b
Author | SHA1 | Date | |
---|---|---|---|
|
fa7205481b | ||
|
f3021964de |
@ -12,10 +12,13 @@ use strict;
|
||||
# gashapwn
|
||||
# Nov 2020
|
||||
|
||||
my $GIT_REPO = 'https://git.lain.church/gashapwn/lyadmin.git';
|
||||
|
||||
|
||||
my $pwuid;
|
||||
my $admin_un;
|
||||
|
||||
my $admin_home_dir;
|
||||
|
||||
# Make sure we're running as root
|
||||
$pwuid = getpwuid( $< );
|
||||
@ -32,3 +35,13 @@ if( ($admin_un) = `tail /etc/passwd | grep -v "nobody:"` =~ /([^:\n]+):[^:]+:[0-
|
||||
die "create a non-root user & set user passsword before running this script."
|
||||
}
|
||||
|
||||
$admin_home_dir = "/home/$admin_un";
|
||||
|
||||
# grant doas access to admin user
|
||||
system("echo 'permit $admin_un' > /etc/doas.conf");
|
||||
|
||||
# install git
|
||||
system("pkg_add git");
|
||||
chdir $admin_home_dir;
|
||||
system("su gashapwn -c 'git clone $GIT_REPO'");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user