diff --git a/deploy/data/linux/post_install.sh b/deploy/data/linux/post_install.sh index 2c6811e74..f69de3d57 100755 --- a/deploy/data/linux/post_install.sh +++ b/deploy/data/linux/post_install.sh @@ -27,27 +27,18 @@ fi sudo chmod -R a-w $APP_PATH/ -sudo cp $APP_PATH/service/$APP_NAME.service /etc/systemd/system/ >> $LOG_FILE +sudo cp $APP_PATH/$APP_NAME.service /etc/systemd/system/ >> $LOG_FILE sudo systemctl start $APP_NAME >> $LOG_FILE sudo systemctl enable $APP_NAME >> $LOG_FILE -sudo ln -s $APP_PATH/client/$APP_NAME.sh /usr/sbin/$APP_NAME >> $LOG_FILE - +sudo chmod 555 $APP_PATH/client/$APP_NAME.sh >> $LOG_FILE +sudo ln -s $APP_PATH/client/$APP_NAME.sh /usr/local/sbin/$APP_NAME >> $LOG_FILE +sudo ln -s $APP_PATH/client/$APP_NAME.sh /usr/local/bin/$APP_NAME >> $LOG_FILE echo "user desktop creation loop started" >> $LOG_FILE -getent passwd {1000..6000} | while IFS=: read -r name password uid gid gecos home shell; do - echo "name: $name" - if ! test -f /home/$name/.icons; then - mkdir /home/$name/.icons/ >> $LOG_FILE - fi - - cp -f $APP_PATH/client/share/icons/AmneziaVPN_Logo.png /home/$name/.icons/ >> $LOG_FILE - cp $APP_PATH/client/$APP_NAME.desktop /home/$name/Desktop/ >> $LOG_FILE - - sudo chown $name:$name /home/$name/.local/share/gvfs-metadata/home* >> $LOG_FILE - sudo -u $name dbus-launch gio set /home/$name/Desktop/AmneziaVPN.desktop "metadata::trusted" yes >> $LOG_FILE - sudo chown $name:$name /home/$name/Desktop/AmneziaVPN.desktop >> $LOG_FILE -done +sudo cp $APP_PATH/$APP_NAME.desktop /usr/share/applications/ >> $LOG_FILE +sudo chmod 555 /usr/share/applications/$APP_NAME.desktop >> $LOG_FILE + echo "user desktop creation loop ended" >> $LOG_FILE date >> $LOG_FILE diff --git a/deploy/data/linux/post_uninstall.sh b/deploy/data/linux/post_uninstall.sh index acf090280..029bb7cf6 100755 --- a/deploy/data/linux/post_uninstall.sh +++ b/deploy/data/linux/post_uninstall.sh @@ -29,47 +29,30 @@ if test -f /etc/systemd/system/$APP_NAME.service; then sudo rm -rf /etc/systemd/system/$APP_NAME.service >> $LOG_FILE fi -if test -f /usr/bin/$APP_NAME; then - sudo rm -rf /usr/sbin/$APP_NAME >> $LOG_FILE -fi - if test -f $APP_PATH; then sudo rm -rf $APP_PATH >> $LOG_FILE fi if test -f /usr/sbin/$APP_NAME; then - sudo rm -rf /usr/sbin/$APP_NAME >> $LOG_FILE + sudo rm -f /usr/sbin/$APP_NAME >> $LOG_FILE fi -if test -f /usr/sbin/$APP_NAME-service; then - sudo rm -rf /usr/sbin/$APP_NAME-service >> $LOG_FILE +if test -f /usr/bin/$APP_NAME; then + sudo rm -f /usr/bin/$APP_NAME >> $LOG_FILE fi -getent passwd {1000..6000} | while IFS=: read -r name password uid gid gecos home shell; do - if test -f /home/$name/Desktop/$APP_NAME\ client.desktop; then - sudo rm -rf /home/$name/Desktop/$APP_NAME\ client.desktop >> $LOG_FILE - fi - - if test -f /home/$name/Desktop/$APP_NAME.desktop; then - sudo rm -rf /home/$name/Desktop/$APP_NAME.desktop >> $LOG_FILE - fi - - if test -f /home/$name/.config/$APP_NAME.ORG; then - sudo rm -rf /home/$name/.config/$APP_NAME.ORG >> $LOG_FILE - fi +if test -f /usr/local/bin/$APP_NAME; then + sudo rm -f /usr/local/bin/$APP_NAME >> $LOG_FILE +fi - if test -f /home/$name/.local/share/$APP_NAME.ORG; then - sudo rm -rf /home/$name/.local/share/$APP_NAME.ORG >> $LOG_FILE - fi +if test -f /usr/local/sbin/$APP_NAME; then + sudo rm -f /usr/local/sbin/$APP_NAME >> $LOG_FILE +fi - if test -f /home/$name/.local/share/$APP_NAME; then - sudo rm -rf /home/$name/.local/share/$APP_NAME >> $LOG_FILE - fi +if test -f /usr/share/applications/$APP_NAME.desktop; then + sudo rm -f /usr/share/applications/$APP_NAME.desktop >> $LOG_FILE - if test -f /home/$name/.icons/AmneziaVPN_Logo.png; then - sudo rm -rf /home/$name/.icons/AmneziaVPN_Logo.png >> $LOG_FILE - fi -done +fi date >> $LOG_FILE echo "Service after uninstall status:" >> $LOG_FILE