Skip to content

Commit 84e0d78

Browse files
committed
Add some simple generic_tasks for testing
1 parent c9b13ab commit 84e0d78

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
# nothing to compile
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# This is an example to upgrade the chroot packages
3+
# The basic calling convention of these scripts is:
4+
# ./script <working_dir> <output_file>
5+
6+
output_file="$1"
7+
8+
exec &>> "${output_file}"
9+
10+
bin/dj_run_chroot "apt-get update"
11+
bin/dj_run_chroot "apt-get full-upgrade -y"
12+
13+
exit 0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
# nothing to compile
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/sh
2+
# This is the default script to retrieve a the configuration of both
3+
# software & hardware of the judgehost. The basic
4+
# calling convention of these scripts is:
5+
# ./script <working_dir> <output_file>
6+
7+
output_file="$1"
8+
9+
# Source - https://stackoverflow.com/a
10+
# Posted by fjarlq, modified by community. See post 'Timeline' for change history
11+
# Retrieved 2025-11-15, License - CC BY-SA 4.0
12+
13+
if [ "${SHELL#*"bash"}" != "${SHELL}" ]; then
14+
exec &>> "${output_file}"
15+
else
16+
# We can't use &>> as it's not POSIX,
17+
# this does introduce a racecondition
18+
exec 1>> "${output_file}"
19+
exec 2>> "${output_file}"
20+
fi
21+
22+
# Generic linux/distro information
23+
uname -a
24+
cat /etc/os-release
25+
26+
# Information about the php version
27+
php -v
28+
29+
# Generic hardware information
30+
lsusb
31+
lspci
32+
lscpu
33+
cat /proc/cpuinfo
34+
free -h
35+
cat /proc/meminfo
36+
37+
if [ command -v hwinfo ]; then
38+
hwinfo --short
39+
fi
40+
41+
if [ command -v inxi ]; then
42+
inxi -Fx
43+
fi
44+
45+
exit 0

0 commit comments

Comments
 (0)