mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-02 16:03:45 +00:00
Allow the use of pwgen to generate passwords
This commit is contained in:
Vendored
+1
-1
@@ -23,7 +23,7 @@ Replaces: shadowsocks (<< 1.5.3-2)
|
||||
Breaks: shadowsocks (<< 1.5.3-2)
|
||||
Architecture: any
|
||||
Depends:
|
||||
apg,
|
||||
apg | pwgen,
|
||||
libcap2-bin [linux-any],
|
||||
lsb-base (>= 3.0-6),
|
||||
${misc:Depends},
|
||||
|
||||
Vendored
+6
-1
@@ -26,7 +26,12 @@ case "$1" in
|
||||
cap_net_bind_service+ep /usr/bin/ss-server \
|
||||
cap_net_bind_service+ep /usr/bin/ss-tunnel
|
||||
if [ ! -f /etc/shadowsocks-libev/config.json ]; then
|
||||
passwd=$(apg -n 1 -M ncl)
|
||||
pathfind apg
|
||||
if [ $? -eq 0 ]; then
|
||||
passwd=$(apg -n 1 -M ncl)
|
||||
else
|
||||
passwd=$(pwgen 12 1)
|
||||
fi
|
||||
mkdir -p /etc/shadowsocks-libev
|
||||
sed "s/barfoo!/$passwd/" /usr/share/shadowsocks-libev/config.json \
|
||||
> /etc/shadowsocks-libev/config.json
|
||||
|
||||
Reference in New Issue
Block a user