Upload full Albumik YunoHost package
This commit is contained in:
32
scripts/_common.sh
Executable file
32
scripts/_common.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
app=${YNH_APP_INSTANCE_NAME:-albumik}
|
||||
install_dir="/var/www/$app"
|
||||
data_dir="/home/yunohost.app/$app"
|
||||
config_dir="/etc/$app"
|
||||
service_file="/etc/systemd/system/$app.service"
|
||||
|
||||
find_free_port() {
|
||||
python3 - <<'PY'
|
||||
import socket
|
||||
for p in range(8097, 8297):
|
||||
s=socket.socket()
|
||||
try:
|
||||
s.bind(('127.0.0.1', p))
|
||||
print(p)
|
||||
break
|
||||
except OSError:
|
||||
pass
|
||||
finally:
|
||||
s.close()
|
||||
PY
|
||||
}
|
||||
|
||||
normalize_path() {
|
||||
local p="$1"
|
||||
[ -z "$p" ] && p="/"
|
||||
[[ "$p" != /* ]] && p="/$p"
|
||||
[ "$p" != "/" ] && p="${p%/}"
|
||||
echo "$p"
|
||||
}
|
||||
Reference in New Issue
Block a user