Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
infra
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Vasile
infra
Commits
6face76e
Commit
6face76e
authored
4 months ago
by
James Vasile
Browse files
Options
Downloads
Patches
Plain Diff
Add admin script to silicon
parent
66658eaf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boxes/silicon/admin
+45
-0
45 additions, 0 deletions
boxes/silicon/admin
with
45 additions
and
0 deletions
boxes/silicon/admin
0 → 100755
+
45
−
0
View file @
6face76e
#!/usr/bin/env bash
# Do - The Simplest Build Tool on Earth.
# Documentation and examples see https://github.com/8gears/do
set
-eu
VERSION
=
"0.0.1"
SCRIPTNAME
=
`
basename
"
$0
"
`
BASEDIR
=
$(
realpath
$(
cd
--
"
$(
dirname
--
"
${
BASH_SOURCE
[0]
}
"
)
"
&> /dev/null
&&
pwd
))
if
[
"
$(
id
-u
)
"
-ne
0
]
;
then
echo
'This script must be run by root'
>
&2
exit
1
fi
_apt-get-install
()
{
DPKG
=
`
dpkg
-l
`
packages
=(
"
$@
"
)
for
file
in
"
${
packages
[@]
}
"
;
do
if
!
echo
"
$DPKG
"
|
grep
-qF
"
$file
"
;
then
apt-get
install
-y
$@
break
fi
done
}
lid-off
()
{
echo
Turning off lid-triggered
sleep
mkdir
-p
/etc/systemd/logind.conf.d
pushd
/etc/systemd/logind.conf.d
echo
-e
'[Login]\nHandleLidSwitch=ignore\nHandleLidSwitchExternalPower=ignore\nHandleLidSwitchDocked=ignore\nLidSwitchIgnoreInhibited=yes'
>
lid.conf
popd
systemctl reload systemd-logind
}
lid-on
()
{
echo
Turning on lid-triggered
sleep
rm
/etc/systemd/logind.conf.d/lid.conf
systemctl reload systemd-logind
}
"
$@
"
# <- execute the task
[
"$#"
-gt
0
]
||
printf
"Usage:
\n\t
./
${
SCRIPTNAME
}
%s
\n
"
"(
$(
compgen
-A
function
|
grep
'^[^_]'
|
paste
-sd
'|'
-
)
)"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment