This reverts commit 01bc3762b2.
Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
Reviewed-on: #87
This commit was merged in pull request #87.
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
|
||||
apt update && apt install sudo
|
||||
addgroup nasp
|
||||
|
||||
insert_if_not_exist()
|
||||
{
|
||||
filename=$1
|
||||
line=$2
|
||||
if [ ! -f "$filename" ]; then
|
||||
touch $filename
|
||||
fi
|
||||
grep -qxF -- "$line" "$filename" || echo "$line" >> "$filename"
|
||||
}
|
||||
|
||||
insert_if_not_exist "/etc/crontab" "*/5 * * * * root cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/testbed_cron.sh"
|
||||
|
||||
"$THIS_DIR"/testbed_cron.sh
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
|
||||
apt update && apt install sudo
|
||||
addgroup nasp
|
||||
|
||||
insert_if_not_exist()
|
||||
{
|
||||
filename=$1
|
||||
line=$2
|
||||
if [ ! -f "$filename" ]; then
|
||||
touch $filename
|
||||
fi
|
||||
grep -qxF -- "$line" "$filename" || echo "$line" >> "$filename"
|
||||
}
|
||||
|
||||
insert_if_not_exist "/etc/crontab" "*/5 * * * * root cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/testbed_cron.sh"
|
||||
|
||||
"$THIS_DIR"/testbed_cron.sh
|
||||
|
||||
Reference in New Issue
Block a user