Compare commits

16 Commits

Author SHA1 Message Date
29adac2e70 Merge branch 'master' into jbomb-automate
Some checks failed
/ Lint Check Shellscripts (push) Failing after 11s
/ Lint Check Shellscripts (pull_request) Failing after 11s
2026-01-06 11:33:00 +00:00
9c56e9b87a Update .gitea/workflows/lint.yaml
Some checks failed
/ Lint Check Shellscripts (push) Failing after 12s
2026-01-06 11:32:23 +00:00
f01555b0e5 Update .gitea/workflows/lint.yaml
Some checks failed
/ Lint Check Shellscripts (push) Failing after 10s
2026-01-06 11:31:15 +00:00
2bf64689db Update .gitea/workflows/lint.yaml
Some checks failed
/ Lint Check Shellscripts (push) Failing after 10s
2026-01-06 11:30:35 +00:00
e66abe2467 Update .gitea/workflows/lint.yaml
Some checks failed
/ Lint Check Shellscripts (push) Failing after 13s
2026-01-06 11:28:41 +00:00
364d967b8f Update .gitea/workflows/lint.yaml 2026-01-06 11:28:10 +00:00
46bfeaa6fe Update .gitea/workflows/lint.yaml
Some checks failed
/ Lint Check Shellscripts (push) Failing after 14s
2026-01-06 11:24:50 +00:00
9e3a36aa0e user management commands automated
Some checks failed
/ Lint Check Shellscripts (push) Failing after 32s
/ Lint Check Shellscripts (pull_request) Failing after 12s
2026-01-06 11:20:33 +00:00
3ea86d7e35 user management commands automated 2026-01-06 11:20:33 +00:00
a1e8a03f60 user management commands automated 2026-01-06 11:20:33 +00:00
ee39307fac Update .NOAI
Some checks failed
/ Lint Check Shellscripts (push) Failing after 48s
2026-01-04 06:31:42 +00:00
00824af5b2 Update .NOAI 2026-01-04 06:28:01 +00:00
6d1f59e50d Update .gitea/workflows/lint.yaml 2026-01-04 06:26:00 +00:00
cb10a22c3d Add .gitea/workflows/lint.yaml 2026-01-04 06:25:15 +00:00
64e15bc2a9 Merge pull request 'year refresh' (#3) from test into master
Reviewed-on: #3
2026-01-02 16:30:38 +00:00
7b1d8d76b0 year refresh (#3)
Reviewed-on: #3
2026-01-02 16:30:04 +00:00
2 changed files with 63 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
on: [push, pull_request]
jobs:
CI:
name: Lint Check Shellscripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Linter
run: |
wget -qO- 'https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.aarch64.tar.xz' | tar -xJv
cp 'shellcheck-v0.11.0/shellcheck' /usr/local/bin
rm -rf "shellcheck-v0.11.0"
shellcheck --version
- name: Run Linter
run: |
shellcheck penv
shellcheck jconf

48
jconf
View File

@@ -42,14 +42,56 @@ fi
cmd=$1
case "$cmd" in
adduser)
echo
exist=$(awk -F: -v username="$2" '{if ($1 == username && $3 >= 1000 && $1 != "nobody") {print 1; found=1; exit}} END {if (!found) print 0}' /etc/passwd)
if [ "$exist" -eq 1 ]; then
echo "$2 user already exists"
else
while true; do
read -p "Do you want to create an user account $2 [Y/n]:" yn
case $yn in
[Yy]* )
useradd $2;
echo "Enter the password for $2:";
passwd $2
echo "$2 user account created successfully";
break;;
[Nn]* ) exit 1;;
* ) echo "Please answer Y or N.";;
esac
done
fi
exit 1
;;
deluser)
echo
exist=$(awk -F: -v username="$2" '{if ($1 == username && $3 >= 1000 && $1 != "nobody") {print 1; found=1; exit}} END {if (!found) print 0}' /etc/passwd)
if [ "$exist" -eq 0 ]; then
echo "$2 user doesn't exist"
exit 1
else
while true; do
read -p "Do you want to delete $2 user account? [Y/n]:" yn
case $yn in
[Yy]* )
userdel -rRZ $2;
echo "$2 user account deleted successfully";
break;;
[Nn]* ) exit 1;;
* ) echo "Please answer yes or no.";;
esac
done
fi
exit 1
;;
listusers)
echo
husers= awk -F: '{ if ($3 >= 1000 && $1 != "nobody" ) {print $1}}' /etc/passwd
echo $husers
;;
start)
echo
;;