Skip to content

Commit

Permalink
Merge pull request #37 from rulanugrh/main
Browse files Browse the repository at this point in the history
chore: memperbaiki actions dan script serta menambahkan materi
  • Loading branch information
rulanugrh authored Oct 2, 2024
2 parents fbc790b + 83b4c22 commit 903d1d2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/testing_shell.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: github action shell
on: [pull]
on: [pull_request, push]
jobs:
test-shell-scripting:
runs-on: ubuntu-latest
Expand All @@ -12,9 +12,9 @@ jobs:
- run: echo "jalan pada ${{ runner.os }}"
- name: list dari direktori shell scripting
run: |
d=$(date + "%Y-%m-%d")
d=$(date "+%Y-%m-%d")
file="/tmp/test.txt.$$" && touch --date "$d" "$file"
echo $file && find . -iname "*.sh" -type f -newer $file > output.txt
for i in $(cat output.txt); do chmod +x $i && sh $i; done
echo $file && find . -type d \( -path ./playground -o -path ./simple_project -o -path ./basic -o -path ./advance/03_user_administration -o -path ./advance/01_advance_file -o -path ./usefull_command \) -prune -o -iname "*.sh" -type f -newer $file > output.txt
for i in $(cat output.txt); do if [ -d "$i" ]; then echo "$i adalah folder."; elif [ -f "$i" ]; then chmod +x "$i" && bash "$i"; else echo "$i tidak ditemukan atau bukan file/folder."; fi; done
- run: echo "status ${{ job.status }}"
2 changes: 1 addition & 1 deletion advance/00_regex/regex.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
awk -e '$1 ~ /p[o]/ {print $0}' buah.txt
awk -e '$1 ~ /p[o]/ {print $0}' ./advance/00_regex/buah.txt
8 changes: 4 additions & 4 deletions advance/03_user_administration/user_administration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ check_os() {
esac
}

if ["$(dpkg -l | awk '/sudo/ {print }' | wc -l)" -le 1]; then
check_os()
sleep 5
if [ "$(dpkg -l | awk '/sudo/ {print }' | wc -l)" -le 1 ];
then
check_os
fi

echo -e "create new user kyora ..."
useradd kyora && echo -e "1\n\1n" | passwd kyora
sleep 2

echo -e "add kyora to sudoers ..."
usermod -aG sudo kyora
4 changes: 2 additions & 2 deletions advance/04_system_logging/system_logging.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

echo "Ini adalah custom logger" > /var/log/customlog
logger -f /var/log/customlog
echo "Ini adalah custom logger" > test.log
logger -f test.log

0 comments on commit 903d1d2

Please sign in to comment.