+ new sh scripts
This commit is contained in:
35
scr/1_upd_install.sh
Executable file
35
scr/1_upd_install.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# update, upgrade and install / frode klevstul / oct 2025
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "error: run as 'root'"
|
||||
exit
|
||||
fi
|
||||
|
||||
# ---
|
||||
# update server
|
||||
# ---
|
||||
apt update
|
||||
apt -y full-upgrade
|
||||
|
||||
# ---
|
||||
# misc installations
|
||||
# trash-cli - used in misc scripts
|
||||
# nginx - webserver
|
||||
# ---
|
||||
apt -y install trash-cli nginx
|
||||
|
||||
# ---
|
||||
# nginx
|
||||
# ---
|
||||
systemctl enable nginx # enable on startup
|
||||
|
||||
# change mode so given dirs are writable by non-root user (which is nifty)
|
||||
chmod o+w /etc/nginx/sites-enabled/
|
||||
chmod o+w /etc/nginx/sites-available/
|
||||
chmod o+w /etc/nginx/nginx.conf
|
||||
chmod o+w /var/www/
|
||||
32
scr/2a_postgrest_install.sh
Normal file
32
scr/2a_postgrest_install.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# install postgrest / frode klevstul / oct 2025
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "error: run as 'root'"
|
||||
exit
|
||||
fi
|
||||
|
||||
# ---
|
||||
# postgrest
|
||||
# ---
|
||||
|
||||
# https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8
|
||||
|
||||
#wget https://github.com/PostgREST/postgrest/releases/latest/download/postgrest-linux-amd64
|
||||
|
||||
#https://github.com/PostgREST/postgrest/releases/latest/download/postgrest-latest-linux-static-x86-64.tar.xz
|
||||
|
||||
|
||||
#https://github.com/PostgREST/postgrest/releases/download/v14.0/postgrest-v14.0-linux-static-x86-64.tar.xz
|
||||
|
||||
|
||||
#wget -qO- --max-redirect=10 https://github.com/PostgREST/postgrest/releases | grep -wo "https.*x86_64.deb\|https.*amd64.deb" | head -n 1 | xargs -I {} wget -O test.deb {}
|
||||
|
||||
cd /tmp
|
||||
|
||||
curl -s https://api.github.com/repos/PostgREST/postgrest/releases/latest | sed 's/[()",{}]/ /g; s/ /\n/g' | grep "https.*releases/download*static*.*tar.xz"
|
||||
|
||||
15
scr/2b_postgrest_config.sh
Normal file
15
scr/2b_postgrest_config.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# config postgrest / frode klevstul / oct 2025
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
useradd -M -U -d /nonexistent -s /usr/sbin/nologin postgrest
|
||||
|
||||
cd /tmp
|
||||
wget https://gt.op.fo/fro/srv-pub/raw/branch/trunk/cfg/pgr/postgrest.service
|
||||
cp postgrest.service /etc/systemd/system/
|
||||
|
||||
systemctl enable postgrest
|
||||
systemctl start postgrest
|
||||
systemctl status postgrest
|
||||
Reference in New Issue
Block a user