Skip to content

Instantly share code, notes, and snippets.

@tmpbook
Created December 27, 2018 15:30
Show Gist options
  • Select an option

  • Save tmpbook/0533a37394f96f5a2106eaea1560b655 to your computer and use it in GitHub Desktop.

Select an option

Save tmpbook/0533a37394f96f5a2106eaea1560b655 to your computer and use it in GitHub Desktop.
touch a file with bash
#!/bin/bash
set -ex
mkdir -p /data0/xxxx-access-api/data
chown -R go:go /data0/xxxx-access-api/data
rm -f /etc/supervisord.d/xxxx-access.ini
cat << EOF > /etc/supervisord.d/xxxx-access-api.ini
[program:xxxx-access-api]
user=go
directory=/data0/xxxx-access-api/data
command=/data0/xxxx-access-api/app/xxxx-access-api
autostart=true
autorestart=true
exitcodes=0,2
redirect_stderr=true
stdout_logfile=/data0/www/xxxx-access/xxxx-access.log
EOF
supervisorctl update
@tmpbook

tmpbook commented Dec 27, 2018

Copy link
Copy Markdown
Author

使用 bash 脚本来直接创建有内容的文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment