In this version, some new features are added. The main feature added in this version is called renew port number function. Now it can not only renew password but also can renew the port number.
The QR Code api is also updated to added the port number input function for generate the new QR Code image file.
New Features in this version
- auto get port number in config file
- verify the new generated port number if is in use
- auto add new ufw rules, and delete old rules
The running result
root@vps:~# /usr/local/sbin/change-shadowsocks-password-port-multiuser 6
====================Renew Shadowsocks Password and Port===========================
Time: 2016-02-23 06:00:01
line number you entered is 6
your config file on line 6 is "23735": "4919",
your old port on config file on line 6 is 23735
your old password on config file on line 6 is 4919
check if new port 8736 is in use
port 8736 is not in use
the new port will be 8736
generate a new password 27645
replacing new password 27645 to the shadowsocks config...
replacing new port 8736 to the shadowsocks config file...
updating public api file /var/www/public-api.json...
{"update": "2016-02-23 06:00:01", "port": "8736", "password": "27645"}
updating ufw rules...
enabling new rule on port 8736...
Rule added
Rule added (v6)
disabling old rule on port 23735...
Rule deleted
Rule deleted (v6)
Restarting shadowsocks service...
stopped
All Done!
You can use password 27645 on port 8736 to login shadowsocks service now!